Quick setup
- Python
- TypeScript
Middleware interface
Use three optional hooks:- Event lifecycle:
on_event_change/onEventChange - Handler-result lifecycle:
on_event_result_change/onEventResultChange - Handler registration lifecycle:
on_bus_handlers_change/onBusHandlersChange
Lifecycle
Middleware hooks receive lifecycle statuses in strict order:- Event hooks:
pending->started->completed - Event-result hooks:
pending->started->completed - Handler registration hooks: called when handlers are added or removed via
on(...)andoff(...)
status passed to lifecycle hooks is never error. Handler failures are exposed on event_result.status and event_result.error during the completed callback.