Skip to main content

Documentation Index

Fetch the complete documentation index at: https://abxbus.archivebox.io/llms.txt

Use this file to discover all available pages before exploring further.

EventHistory is the ordered event store owned by each EventBus as bus.event_history. Rust stores the same history inside EventBus runtime state and exposes it through EventBus history methods rather than a standalone public EventHistory type. It is the canonical history backend in each runtime and exposes ordered access, lookup (find), and retention controls.

Common fields

  • max_history_size: max retained events (None/null means unbounded, 0 keeps only in-flight visibility)
  • max_history_drop: whether to trim oldest entries when over limit
  • Ordered mapping keyed by event_id

Mapping interface

EventHistory behaves like an ordered mapping in Python/TypeScript; Go exposes equivalent explicit methods.
from abxbus import EventHistory

history = EventHistory(max_history_size=100, max_history_drop=True)
history[event.event_id] = event

exists = event.event_id in history
loaded = history.get(event.event_id)
count = len(history)

for event_id, item in history.items():
    print(event_id, item.event_type)

Accessor methods

All runtimes expose explicit accessors in addition to mapping methods where the language supports them.
  • add_event(event)
  • get_event(event_id)
  • remove_event(event_id)
  • has_event(event_id)
  • find(...)
  • filter(...)
  • trim_event_history(...)

find(...)

EventHistory.find(...) supports:
  • event pattern ('EventType', class, or '*')
  • where predicate filtering
  • field equality filters (**event_fields in Python, options object fields in TypeScript)
  • past / future windows
  • child_of constraints
EventBus.find(...) delegates to event_history.find(...). Future waiter ownership remains on EventBus; the bus injects the callback used for future waits.

filter(...)

Same as find(...) but returns the list of all matching events (newest to oldest) instead of just the first match. Accepts an additional limit argument to cap the result count. find(...) is implemented as filter(..., limit=1) returning the first result or None / null.

Retention and trim methods

  • trim_event_history / trimEventHistory applies configured retention policy.
  • on_remove callbacks let the caller run cleanup side effects when history entries are removed.

Constructor options

history = EventHistory(max_history_size=100, max_history_drop=False)