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
config_handler = ConfigEventHandler()
instance-attribute
event_bus = event_bus
instance-attribute
file_handler = FileEventHandler()
instance-attribute
handler = AppLifecycleHandler()
instance-attribute
task_handler = TaskEventHandler()
instance-attribute
emit
A method that emits an application event.
Parameters:
-
event_type(AppEventType) –The type of event to emit.
-
data(dict[str, Any] | None, default:None) –Optional event data dictionary.
-
source(str, default:'app') –The source of the event.
Source code in dev_tool/event/app/manager.py
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
initialize_notification_handler
A method that initializes the notification handler.
Parameters:
-
notification_service(NotificationService) –The notification service instance.
Source code in dev_tool/event/app/manager.py
register_config_callback
A method that registers a callback for configuration events.
Parameters:
-
event_type(AppEventType) –The configuration event type to listen for.
-
callback(Callable[[], None]) –The callback function to execute.
Source code in dev_tool/event/app/manager.py
register_file_callback
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.
Source code in dev_tool/event/app/manager.py
register_task_watcher
A method that registers a watcher for task events.
Parameters:
-
watcher(Callable[[dict], None]) –The watcher function to register.
Source code in dev_tool/event/app/manager.py
unregister_config_callback
A method that unregisters a callback for configuration events.
Parameters:
-
event_type(AppEventType) –The configuration event type.
-
callback(Callable[[], None]) –The callback function to remove.
Source code in dev_tool/event/app/manager.py
unregister_file_callback
A method that unregisters a callback for file events.
Parameters:
-
path(Path) –The file path.
-
callback(Callable[[Path], None] | None, default:None) –The callback function to remove, or None to remove all.
Source code in dev_tool/event/app/manager.py
unregister_task_watcher
A method that unregisters a watcher for task events.
Parameters:
-
watcher(Callable[[dict], None]) –The watcher function to unregister.