asphalt.wamp.component
¶
-
class
asphalt.wamp.component.
WAMPComponent
(clients=None, **default_client_args)¶ Creates one or more
WAMPClient
resources.If the
clients
argument is omitted or empty, a default client with the context attributewamp
will be created.If
clients
is defined, any keyword arguments to the component become default options for the clients.If you wish to change the context attribute of a WAMP client, use the
context_attr
argument.Parameters: - clients (
Optional
[Dict
[str
,Dict
[str
,Any
]]]) – a dictionary of resource name ⭢WAMPClient
constructor arguments - default_client_args –
WAMPClient
base options for all clients or arguments for the default client ifclients
is not specified
-
coroutine
start
(self, ctx)¶ Perform any necessary tasks to start the services provided by this component.
- In this method, components typically use the context to:
- add resources and/or resource factories to it
(
add_resource()
andadd_resource_factory()
) - request resources from it asynchronously
(
request_resource()
)
- add resources and/or resource factories to it
(
It is advisable for Components to first add all the resources they can to the context before requesting any from it. This will speed up the dependency resolution and prevent deadlocks.
Parameters: ctx ( Context
) – the containing context for this component
- clients (