koi_net.infra.lifecycle

Classes

NodeLifecycle(log, shutdown_signal, ...)

NodeState(*values)

class koi_net.infra.lifecycle.NodeLifecycle(log, shutdown_signal, exception_queue, logging_context, artifact, container)[source]

Bases: object

Parameters:
  • log (Logger)

  • shutdown_signal (Event)

  • exception_queue (Queue[Exception])

  • logging_context (LoggingContext)

  • artifact (BuildArtifact)

  • container (Any)

artifact: BuildArtifact
container: Any
exception_queue: Queue[Exception]
log: Logger
logging_context: LoggingContext
shutdown_signal: Event
start(block=True)[source]

Starts the lifecycle manager thread, beginning node startup.

Parameters:

block (bool)

startup_signal: Event
state: NodeState = 'IDLE'
stop(block=True)[source]

Signals to lifecycle manager thread, beginning node shutdown.

Parameters:

block (bool)

thread: Thread | None = None
class koi_net.infra.lifecycle.NodeState(*values)[source]

Bases: StrEnum

IDLE = 'IDLE'
RUNNING = 'RUNNING'
STARTING = 'STARTING'
STOPPING = 'STOPPING'