pytilities.event.dispatcherswitch — Pytilities v1.0.0 documentation

### Navigation

- index
- modules |
- next |
- previous |
- Pytilities v1.0.0 documentation »
- API documentation »
- pytilities »
- pytilities.event »

# 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
  > - ...

  `_DispatcherSwitch__get_dispatcher_for_event`(event_name)

    Get the dispatcher for the given event according to our switching rules

  `__init__`()
  `add_handler`()
  `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`()
  `has_event`()
  `remove_handler`()
  `remove_handlers`()
  `__weakref__`

    list of weak references to the object (if defined)

  `events`

### Navigation

- index
- modules |
- next |
- previous |
- Pytilities v1.0.0 documentation »
- API documentation »
- pytilities »
- pytilities.event »