module documentation
Generic event and event handling classes and functions.
| Class | |
This class represents an event. It is actially a list of callable functions, which are the event handlers for this event. Calling an instance of this class will call all the registered event handlers for this event. |
| Class | |
Event data class. This class is used to pass data to event handlers. |
| Class | |
Base class for an event manager. This class manages events and event handlers. It is implememted as a Singleton, so there is only one instance of the event manager in the whole application. |
| Function | event |
Class decorator to automatically register event handlers. Any method of the decorated class that is decorated with an Event decorator will be automatically registered as an event handler for that event. |
| Function | on |
Marks a method for event registration — deferred until instantiation. |
| Type Variable | _F |
The F TypeVar on the decorator overload is important — it tells the type checker that whatever callable goes in comes back out unchanged, so the handler's own signature is preserved after decoration. |
Class decorator to automatically register event handlers.
Any method of the decorated class that is decorated with an Event
decorator will be automatically registered as an event handler for that event.
It is necessary to use this decorator for any class that has methods decorated with onEvent,
otherwise the event handlers will not be registered and the decorated methods will not be
correctly called when the event is raised.
_F =
¶
The F TypeVar on the decorator overload is important — it tells the type checker that whatever callable goes in comes back out unchanged, so the handler's own signature is preserved after decoration.
| Value |
|