orxtra v0.13.0 /dispatch.src.orxtra.dispatch._delivery
On this page

TransientEventDelivery implements EventDelivery via asyncio Futures for wait_for/fire with no replay; match_subscription evaluates a FilterPredicate against an incoming event.

#dispatch.src.orxtra.dispatch._delivery

#dispatch.src.orxtra.dispatch._delivery

#TransientEventDelivery

In-memory event delivery using asyncio Futures.

Implements the EventDelivery protocol from orxtra.protocols. Same semantics as the scheduler's EventRegistry: fire resolves all current waiters, events fired before any waiter registers are silently lost (no replay), and multiple waiters on the same event all receive the same payload.

#fire

python
async def fire(self, event_name: str, payload: dict[str, object] | None=None, *, source: str | None=None) -> None

#wait_for

python
async def wait_for(self, event_name: str, *, deadline_seconds: float) -> dict[str, object] | None

#match_subscription

python
async def match_subscription(event_type: str, principal_id: UUID | None, data: dict[str, Any] | None, filter_predicate: FilterPredicate, resolve_source_principals: SourcePrincipalResolver) -> bool

Evaluate whether an event matches a subscription's filter.

Filter semantics (AND-combined; None = wildcard on that axis):

  • event_types: if set, event_type must be in the list.
  • principal_id: if set, the event's principal_id must equal this

value exactly.

  • sources: if set (a list of source slugs), the event's

principal_id must be one of the source principals those slugs resolve to. Slugs are the authoring interface; principals are the runtime identity. The injected resolve_source_principals callback bridges the two so dispatch never touches identity storage directly.

  • data_predicates: reserved for future jsonb matching; ignored now.
Search