asphalt.wamp.component¶
-
class
asphalt.wamp.component.WAMPComponent(clients=None, **default_client_args)¶ Creates one or more
WAMPClientresources.If the
clientsargument is omitted or empty, a default client with the context attributewampwill be created.If
clientsis 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_attrargument.Parameters: - clients (
Optional[Dict[str,Dict[str,Any]]]) – a dictionary of resource name ⭢WAMPClientconstructor arguments - default_client_args –
WAMPClientbase options for all clients or arguments for the default client ifclientsis 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 (