roboto.domain.triggers.dispatch
Module Contents
DispatchSlot
One target of one trigger at one dedup token: the unit a dispatch claims.
At most one dispatch ever occupies a slot. It is the dispatch table’s primary key and the vocabulary every dispatch port speaks.
TriggerDispatchRecord
Bases: pydantic.BaseModel
Wire-transmissible representation of one trigger dispatch.
A dispatch is one attempt to run one target of one trigger for one matched platform event, deduped at the trigger’s OncePer. The triple (trigger_id, idempotency_token, target_id) is the DispatchSlot; at most one dispatch ever occupies a slot, which is what makes redelivered events safe.
Parameters
data AnyAttributes
TriggerDispatchRecord.claimed_at
When the slot was (most recently) claimed.
TriggerDispatchRecord.dataset_id
The dataset the subject belongs to (the subject itself for a dataset event), which is what a dataset’s page lists dispatches by. None when the subject has no dataset, such as an invocation.
TriggerDispatchRecord.event_id
Id of the platform event occurrence that most recently claimed this slot.
TriggerDispatchRecord.event_type
Type of the platform event that matched.
TriggerDispatchRecord.finalized_at
When the dispatch reached a terminal status; None while claimed.
TriggerDispatchRecord.idempotency_token
Dedup token derived from the matched event at the trigger’s once_per ({event.type}|{once_per}:{projection}).
TriggerDispatchRecord.result_ref
What a dispatched target produced: an invocation id, an agent thread id, or a Slack message timestamp, per target_type.
Properties
TriggerDispatchRecord.slot
The slot this dispatch occupies.
Attributes
TriggerDispatchRecord.status_detail
Human-readable detail for status, e.g. the error a failed target raised.
TriggerDispatchRecord.subject
The entity the matched platform event was about, as a roboto:// URI; the same value as the event’s own subject.
Properties
TriggerDispatchRecord.subject_uri
subject as a parsed RobotoUri.
Attributes
TriggerDispatchRecord.target_type
Kind of target dispatched.
TriggerDispatchStatus
Bases: roboto.compat.StrEnum
Lifecycle state of one dispatch: one attempt to run one target for one matched event.
Attributes
TriggerDispatchStatus.Claimed
The dispatch slot is claimed and the target is about to run. A claim that neither finalizes nor is reclaimed within the redelivery grace period is presumed dead and may be claimed again, so delivery is at-least-once: a target may run twice for one event.
TriggerDispatchStatus.Dispatched
The target ran; TriggerDispatchRecord.result_ref points at what it produced.
TriggerDispatchStatus.Failed
The target raised; a redelivered event may claim the slot again.
TriggerDispatchStatus.Unknown
The claim outlived every redelivery of its event without finalizing, so the outcome cannot be determined. Set by an operational sweep, never reclaimable.