budosystems.events.message_bus¶
Event-driven message bus related classes and functions.
Module Attributes
Event-type type variable. |
|
Type alias for the signature of event handlers. In regular Python, it looks like::. |
|
Pair of (event_type, event_handler). |
Classes
The event message bus. |
- class EventType_contra¶
Event-type type variable. Used throughout
MessageBus
methods. (bound
=Event
)alias of TypeVar(‘EventType_contra’, bound=
Event
, contravariant=True)
- AsyncEventHandler¶
Type alias for the signature of event handlers. In regular Python, it looks like:
async def handler(event: EventOrSubtype) -> None: ...
alias of
Callable
[[EventType_contra
],Awaitable
[None
]]
- Registration¶
Pair of (event_type, event_handler).
alias of
Tuple
[Type
[EventType_contra
],Callable
[[EventType_contra
],Awaitable
[None
]]]