manager
dev_tool.event.app.manager
AppEventManager
A manager class for application lifecycle events.
This class handles the registration and emission of application events through an event bus system with lifecycle hooks.
The constructor for the AppEventManager class.
Parameters:
-
event_bus(EventBus) –The event bus instance for publishing events.
Source code in dev_tool/event/app/manager.py
event_bus = event_bus
instance-attribute
handler = AppLifecycleHandler()
instance-attribute
emit_app_event
A method that emits an application lifecycle event.
Parameters:
-
event_type(AppEventType) –The type of application event to emit.
-
data(dict[str, Any] | None, default:None) –Optional event data dictionary.
Source code in dev_tool/event/app/manager.py
register_hook
A method that registers a function to run when an application event occurs.
Parameters:
-
event_type(AppEventType) –The application event type to listen for.
-
function(Callable) –The callback function to execute when the event occurs.