autobahn.asyncio.component


Module Contents

Classes

Component

A component establishes a transport and attached a session

Functions

run(components[, start_loop, log_level])

High-level API to run a series of components.

class autobahn.asyncio.component.Component(main=None, transports=None, config=None, realm='realm1', extra=None, authentication=None, session_factory=None, is_fatal=None)[source]

Bases: autobahn.wamp.component.Component

A component establishes a transport and attached a session to a realm using the transport for communication.

The transports a component tries to use can be configured, as well as the auto-reconnect strategy.

log
session_factory

The factory of the session we will instantiate.

_is_ssl_error(e)[source]

Internal helper.

_check_native_endpoint(endpoint)[source]
_connect_transport(loop, transport, session_factory, done)[source]

Create and connect a WAMP-over-XXX transport.

_wrap_connection_future(transport, done, conn_f)[source]
start(loop=None)[source]

This starts the Component, which means it will start connecting (and re-connecting) to its configured transports. A Component runs until it is “done”, which means one of: - There was a “main” function defined, and it completed successfully; - Something called .leave() on our session, and we left successfully; - .stop() was called, and completed successfully; - none of our transports were able to connect successfully (failure);

Returns

a Future which will resolve (to None) when we are “done” or with an error if something went wrong.

autobahn.asyncio.component.run(components, start_loop=True, log_level='info')[source]

High-level API to run a series of components.

This will only return once all the components have stopped (including, possibly, after all re-connections have failed if you have re-connections enabled). Under the hood, this calls

XXX fixme for asyncio

– if you wish to manage the loop yourself, use the autobahn.asyncio.component.Component.start() method to start each component yourself.

Parameters
  • components (instance or list of autobahn.asyncio.component.Component) – the Component(s) you wish to run

  • start_loop (bool) – When True (the default) this method start a new asyncio loop.

  • log_level (string) – a valid log-level (or None to avoid calling start_logging)