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)
pending_events_queue, the runtime field is pending_event_queue in both Python and TypeScript.
What each store is for
| Store | Purpose | Typical contents |
|---|---|---|
pending_event_queue | Scheduling buffer | events waiting their turn to start |
event_history | Observability + lookup | recent pending/started/completed events, bounded by history settings |
Retention config options
| Option | Meaning |
|---|---|
max_history_size | Max number of events retained in event_history (null/None means unbounded, 0 means keep only in-flight visibility). |
max_history_drop | If true, accept new events and trim oldest history entries when over limit. If false, reject new events at the limit (for max_history_size > 0). |
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
Inspecting queue vs history at runtime
- Python
- TypeScript