To extend emit.Router
(for example, to add a new dispatch backend) it's most helpful to override the following methods:
__init__(self, your_args, *args, **kwargs)
This is the
__init__
pattern used by the current dispatch backends.dispatch(origin, destination, message)
Do dispatching. Typically passes along
origin
(as_origin
) with the message.wrap_node(node, options)
Given a wrapped function (
node
), do additional processing on the function or node. Unhandled arguments toRouter.node
are passed as a dictionary asoptions
.
See the following example (the current RQRouter
implementation):
../../emit/router.py