pending_event_queue: events accepted by the bus but not yet started by the runloopevent_history: events the bus knows about (pending, started, and completed until trimmed)
What each store is for
The key difference: queue is “what still needs to start”, history is “what this bus has seen”.
Retention config options
Event lifecycle: queue -> history -> trim
- Emit:
- Event is accepted.
- Event is added to
event_history. - Event is enqueued into
pending_event_queue.
- Runloop begins processing:
- Event is removed from
pending_event_queue. - Event stays in
event_historywhile handlers run.
- Event is removed from
- Completion:
- Event is marked completed.
- Event may remain in
event_historyor be dropped based on retention settings.
- Trimming:
max_history_sizeandmax_history_dropdetermine whether old history is removed or new emits are rejected.
Trimming behavior by mode
max_history_size = None/null: no automatic history limit.max_history_size = 0: completed events are removed immediately; only pending/in-flight visibility remains.max_history_size > 0andmax_history_drop = false: bus rejects new emits once history reaches the limit.max_history_size > 0andmax_history_drop = true: bus trims oldest history entries (prefers completed first; can drop uncompleted entries under extreme pressure).
Common configurations
- Python
- TypeScript
- Go
- Rust
Inspecting queue vs history at runtime
- Python
- TypeScript
- Go
- Rust