.. currentmodule:: event_collector Router ====== **Source code:** `event_collector.base.router.py` .. py:module:: event_collector.base.router This module contains definition for the base router class and the simple router. .. pull-quote:: A `Router` is used to dispatch an event payload to collectors. The default router is ``SimpleRouter`` and is used by the collector queue to handle events if no custom router is supplied at initialization. .. autoclass:: event_collector.router.Router :members: handle_event :member-order: bysource This is the abstract base class for a router. .. autoattribute:: collectors The router should be initialized with a dict of Collector instances (with Collector ``key`` as the dict key and the Collector instance as the dict value). The collector dict will be used to handle event routing by the ``handle_event`` method. .. autoclass:: event_collector.router.SimpleRouter :members: handle_event :member-order: bysource .. autoattribute:: collectors As with the base ``Router``, ``collectors`` should be a dict of Collector instances (``CollectorDict``).