crossbar.node.controller

Classes

NodeController

A native Crossbar.io process (currently: controller, router or container).

Functions

create_process_env(options)

Create worker process environment dictionary.

Module Contents

class NodeController(node)[source]

Bases: crossbar.common.process.NativeProcess

A native Crossbar.io process (currently: controller, router or container).

WORKER_TYPE = 'controller'[source]
static _cleanup_worker(reactor, worker)[source]

This is called during reactor shutdown and ensures we wait for our subprocesses to shut down nicely.

_node[source]
_pid[source]
_shutdown(restart=False, mode=None)[source]
_shutdown_requested = False[source]
_shutdown_was_clean = None[source]
_smonitor[source]
_start_guest_worker(worker_id, worker_config, details=None)[source]

Start a new guest process on this node.

Parameters:

config (dict) – The guest process configuration.

Returns:

The PID of the new process.

_start_native_worker(worker_type, worker_id, worker_options=None, details=None)[source]
_started = None[source]
_stop_guest_worker(worker_id, kill=False, details=None)[source]

Stops a currently running guest worker.

Parameters:

worker_id (str) – The ID of the guest worker to stop.

_stop_native_worker(worker_id, kill, details=None)[source]
_uri_prefix = 'crossbar'[source]
_workers[source]
cbdir[source]
get_public_key(details: autobahn.wamp.types.CallDetails)[source]
Parameters:

details

Returns:

get_status(details=None)[source]

Return basic information about this node.

Parameters:

details (autobahn.wamp.types.CallDetails) – Call details.

Returns:

Information on the Crossbar.io node.

Return type:

dict

get_system_stats(details=None)[source]

Return system statistics on this node.

Parameters:

details (autobahn.wamp.types.CallDetails) – Call details.

Returns:

Current system statistics for this node.

Return type:

dict

get_worker(worker_id, include_stats=False, details=None)[source]

Return detailed information about worker.

Parameters:
  • worker_id (str) – ID of worker to get information for.

  • include_stats (bool) – If true, include worker run-time statistics.

get_worker_log(worker_id, limit=100, details=None)[source]

Get buffered log for a worker.

Parameters:
  • worker_id (str) – The worker ID to get log output for.

  • limit (int) – Limit the amount of log entries returned to the last N entries.

Returns:

Buffered log for worker.

Return type:

list

get_workers(filter_types=[], details=None)[source]

Returns the list of workers currently running on this node.

Parameters:

filter_types

Returns:

List of worker processes.

Return type:

list[dict]

log[source]
onConnect()[source]

Implements autobahn.wamp.interfaces.ISession.onConnect()

onJoin(details)[source]

Called when process has joined the node’s management realm.

shutdown(restart=False, mode=None, details=None)[source]

Explicitly stop this node.

sign(data: bytes, details: autobahn.wamp.types.CallDetails)[source]
Parameters:
  • data

  • details

Returns:

sign_challenge(challenge_method: str, challenge_extra: Dict[str, Any], channel_id_raw: bytes, channel_id_type: str, details: autobahn.wamp.types.CallDetails)[source]
Parameters:
  • challenge_method

  • challenge_extra

  • channel_id_raw

  • channel_id_type

  • details

Returns:

start_worker(worker_id, worker_type, worker_options=None, details=None)[source]

Start a new worker process in the node.

stop_worker(worker_id, kill=False, details=None)[source]

Stop a running worker.

Parameters:
  • worker_id (str) – ID of worker to stop.

  • kill (bool) – If True, kill the process. Otherwise, gracefully shut down the worker.

Returns:

Stopping information from the worker.

Return type:

dict

create_process_env(options)[source]

Create worker process environment dictionary.