module documentation
Generic event and event handling classes and functions.
| Class | |
Event subscription. |
| Class | |
Event data class. This class is used to pass data to event handlers. |
| Class | |
Event topics are added as new methods to an EventManager instance. Events can be raised by calling those new methods. |
| Function | |
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 |
|