Closed nocarryr closed 1 year ago
See #11 for context...
These are notes (mostly to myself) on how to best implement the proposed additions in the issue linked above:
Dispatcher
register_event
Dispatcher.emit(<name>, ...)
Event
import pydispatch
pydispatch.register_event('signal_a') pydispatch.emit('signal_a')
signal_b = pydispatch.register_event('signal_b') signal_b.emit()
Closed by #22
See #11 for context...
These are notes (mostly to myself) on how to best implement the proposed additions in the issue linked above:
Dispatcher
instance should be made available at the package level.Dispatcher
methods of the global instance should be added as functions at the package level mapping to the instance.register_event
if an event already exists with that name?Dispatcher.emit(<name>, ...)
method, but exposing theEvent
instances themselves should be available:Dispatcher.emit() method
pydispatch.register_event('signal_a') pydispatch.emit('signal_a')
Event object method
signal_b = pydispatch.register_event('signal_b') signal_b.emit()