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 attribute wamp 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_argsWAMPClient base options for all clients or arguments for the default client if clients 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:

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