Skip to content

EventBus

EventBus

Legacy process-global compatibility wrapper around ModelEventBus.

This class exists mainly to preserve older code paths and tests that still expect a process-global event bus. New code should prefer the model-owned ModelEventBus exposed through model.events.

Under the hood, this wrapper forwards operations to an internal ModelEventBus instance while preserving compatibility with older code that mutates _subscribers directly.

Attributes

_bus class-attribute instance-attribute

_bus = ModelEventBus()

_subscribers class-attribute instance-attribute

_subscribers = _subscribers

Methods:

_sync_bus classmethod

_sync_bus() -> None

Synchronize the wrapper bus with the public compatibility storage.

subscribe classmethod

subscribe(event: FemoraEvent, callback: Callable) -> None

Register a callback through the legacy compatibility wrapper.

unsubscribe classmethod

unsubscribe(event: FemoraEvent, callback: Callable) -> None

Remove a callback through the legacy compatibility wrapper.

emit classmethod

emit(event: FemoraEvent, **payload) -> None

Emit one lifecycle event through the legacy compatibility wrapper.