pytilities.event.dispatcherswitch

class pytilities.event.dispatcherswitch.DispatcherSwitch

Provides a single interface to multiple event dispatchers.

Events are switched to the the first event dispatcher in a list of dispatchers that supports the event, the other dispatchers are ignored for that particular event.

This is also how remove_handlers will look for handlers, it will only remove the handlers of each event’s first found dispatcher; the other ones are ‘hidden’ by this one, for this event.

Check Dispatcher for the documentation of the methods that are left undocumented here.

Instance methods:

  • append_dispatchers: Add dispatchers to the list of dispatchers
  • ...
add_handler(event_name, handler, owner=None)
append_dispatchers(*dispatchers)

Add dispatchers to the end of the list of dispatchers.

Parameters:

dispatchers :: (Dispatcher...)
sequence of dispatchers to append
dispatch(event_name, *args, **keyword_args)
event(event_name, owner=None)
has_event(event_name)
remove_handler(event_name, handler, owner=None)
remove_handlers(event_name=None, owner=None)
attribute_profiles = defaultdict(<class 'pytilities.delegation.profile.Profile'>, {'public': <pytilities.delegation.profile.Profile object at 0x2bf0150>})
events

Previous topic

pytilities.event.dispatcher_

Next topic

pytilities.event.restricteddispatcher

This Page