Skip to main content
Each handler execution for an event produces one EventResult. You usually access results through event.event_results (or high-level event helper methods), but this page documents the underlying object.

Common fields

  • id: unique result id
  • status: pending | started | completed | error
  • result: handler return value (typed by event result schema/type)
  • error: captured exception/error when handler fails
  • started_at, completed_at (None/null until the handler starts/completes)
  • event_children: child events emitted from inside this handler execution
  • Handler metadata (handler_id, handler_name, handler_file_path, bus label/id/name)

Await semantics

Awaiting an EventResult resolves to handler return value or raises captured failure.
entry = event.event_results[some_handler_id]
value = await entry

Scope stack ordering

EventResult execution is intentionally layered as nested scopes/wrappers. These are flow references for execution order, not public API method documentation.
  • eventbus.locks._run_with_handler_lock(...)
  • eventbus._run_with_handler_dispatch_context(...)
  • event_result._run_with_timeout(...)
  • _run_with_slow_monitor(...)
  • event_result._call_handler(...)

Serialization

payload = entry.model_dump(mode='json')
print(payload)
# {
#   "id": "0190...",
#   "status": "completed",
#   "event_id": "018f...",
#   "handler_id": "018g...",
#   "handler_name": "on_user_created",
#   "result": {"user_id": "u_123"},
#   "error": None,
#   "...": "..."
# }

restored = EventResult.model_validate(payload)