crossbar.worker.container¶
Classes¶
A container is a native worker process that hosts application components |
Module Contents¶
- class ContainerController(config=None, reactor=None, personality=None)[source]¶
Bases:
crossbar.worker.controller.WorkerControllerA container is a native worker process that hosts application components written in Python. A container connects to an application router (creating a WAMP transport) and attached to a given realm on the application router.
- get_component(component_id, details=None)[source]¶
Get a component currently running within this container.
- Parameters:
component_id (str) – The ID of the component to get.
details (instance of
autobahn.wamp.types.CallDetails) – Caller details.
- Returns:
Component detail information.
- Return type:
- get_components(details=None)[source]¶
Get components currently running within this container.
- Parameters:
ids_only (bool) – If True, only return (sorted) list of component IDs.
details (instance of
autobahn.wamp.types.CallDetails) – Caller details.
- Returns:
Plain (sorted) list of component IDs, or list of components sorted by component ID when ids_only==True.
- Return type:
- restart_component(component_id, reload_modules=False, details=None)[source]¶
Restart a component currently running within this container using the same configuration that was used when first starting the component.
- Parameters:
component_id (str) – The ID of the component to restart.
reload_modules (bool) – If True, enforce reloading of modules (user code) that were modified (see: TrackingModuleReloader).
details (instance of
autobahn.wamp.types.CallDetails) – Caller details.
:returns dict – A dict with combined info from component stopping/starting.
- shutdown(details=None)[source]¶
Stops the whole container gracefully by stopping all components currently running, and then stopping the container worker.
Note: This behaves more gracefully than stopping the container from outside, using “stop_worker”, and also returns the stopped components.
- start_component(component_id, config, reload_modules=False, details=None)[source]¶
Starts a component in this container worker.
- Parameters:
component_id (str) – The ID under which to start the component.
config (dict) – Component configuration.
reload_modules (bool) – If True, enforce reloading of modules (user code) that were modified (see: TrackingModuleReloader).
details (instance of
autobahn.wamp.types.CallDetails) – Caller details.
- Returns:
Component startup information.
- Return type:
- stop_component(component_id, details=None)[source]¶
Stop a component currently running within this container.
- Parameters:
component_id (int) – The ID of the component to stop.
details (instance of
autobahn.wamp.types.CallDetails) – Caller details.
- Returns:
Stop information.
- Return type: