whistle.typing.dispatcher

class IAbstractEventDispatcher[source]

Bases: Protocol

__init__(*args, **kwargs)
add_listener(event_id, listener, /, *, priority=0)[source]
Parameters:
get_listeners(event_id=None, /)[source]
Parameters:

event_id (str | None)

has_listeners(event_id=None, /)[source]
Parameters:

event_id (str | None)

remove_listener(event_id, listener, /)[source]
Parameters:
class IAsyncEventDispatcher[source]

Bases: IAbstractEventDispatcher, Protocol

async adispatch(event_id, event=None, /)[source]
Parameters:
Return type:

IDispatchedEvent

class IDispatchedEvent[source]

Bases: IEvent, Protocol

dispatcher: IAbstractEventDispatcher
name: str
propagation_stopped: bool
class IEventDispatcher[source]

Bases: IAbstractEventDispatcher, Protocol

dispatch(event_id, event=None, /)[source]
Return type:

IDispatchedEvent