berconpy.dispatch.EventDispatcher¶
- class berconpy.dispatch.EventDispatcher¶
Bases:
ABCThe base class for implementing an event handler system.
Methods
add_listener(event, func, /)Adds a listener for a given event, e.g.
listen([event])A decorator shorthand to add a listener for a given event, e.g.
remove_listener(event, func)Removes a listener from a given event, e.g.
- abstract add_listener(event, func, /)¶
Adds a listener for a given event, e.g.
"on_login".See the Event Reference for a list of supported events.
- listen(event=None)¶
A decorator shorthand to add a listener for a given event, e.g.
"on_login".
- abstract remove_listener(event, func)¶
Removes a listener from a given event, e.g.
"on_login".This method should be a no-op if the given event and function does not match any registered listener.