koi_net.infra.container

Classes

NodeContainer(artifact, components)

Container object returned by assembler, contains components, exposes lifecycle methods.

class koi_net.infra.container.NodeContainer(artifact, components)[source]

Bases: object

Container object returned by assembler, contains components, exposes lifecycle methods.

This class expects the following components to exist, which MUST be included in any assembly: log, root_dir, logging_context, shutdown_signal, and exception_queue. BaseAssembly is a base class implementing these components for that purpose.

The lifecycle methods exposed by the container proxy to the lifecycle object it creates on initialization.

Parameters:

components (dict[str, Any])

exception_queue: Queue[Exception]
get_state()[source]
Return type:

NodeState

log: Logger
logging_context: LoggingContext
root_dir: Path
run()[source]
shutdown_signal: Event
start(block=True)[source]
Parameters:

block (bool)

stop(block=True)[source]
Parameters:

block (bool)