Class Dispatcher⚓︎
Here is the reference information for the Dispatcher class, including all its parameters, attributes, and methods.
You can import the Dispatcher class directly from the trueconf package:
trueconf.Dispatcher ⚓︎
Central dispatcher for routing incoming events.
The dispatcher is the root router of an application. It receives incoming events, applies its own outer middleware chain, and then passes each event to the included root routers in order. Processing stops when a router handles the event, unless that router allows propagation to its child routers.
Dispatcher inherits from Router, so it supports the same handler, middleware, and subrouter registration APIs.
FSM example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
storage | BaseStorage | None | Storage backend used to create an FSM manager. Cannot be used together with | None |
fsm_manager | FSMManager | None | Existing FSM manager instance. Cannot be used together with | None |
key_builder | KeyBuilder | None | Key builder used when creating an FSM manager from | None |
strategy | FSMStrategy | None | FSM strategy used when creating an FSM manager from | None |
Attributes:
| Name | Type | Description |
|---|---|---|
routers | List[Router] | Root routers included in the dispatcher. |
fsm | FSMManager | None | FSM manager configured for the dispatcher, or |
include_router ⚓︎
Include a root router in the dispatcher.
The dispatcher's own middleware is applied in _feed_update before the event reaches child routers. Therefore we do NOT set _parent — child routers should not inherit the dispatcher's middleware through the ancestor chain.