Skip to content
Roboto
Esc
↑↓navigate↵open⌘Jpreview
On this page

roboto.domain.triggers.dispatch

Module Contents

DispatchSlot

class roboto.domain.triggers.dispatch.DispatchSlot#View Source

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.

Attributes

DispatchSlot.idempotency_token

idempotency_token str #

DispatchSlot.target_id

target_id str #

DispatchSlot.trigger_id

trigger_id str #

TriggerDispatchRecord

class roboto.domain.triggers.dispatch.TriggerDispatchRecord(/, **data)#View Source

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 Any

Attributes

TriggerDispatchRecord.claimed_at

claimed_at datetime.datetime #

When the slot was (most recently) claimed.

TriggerDispatchRecord.dataset_id

dataset_id str | None = None #

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

event_id str #

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

finalized_at datetime.datetime | None = None #

When the dispatch reached a terminal status; None while claimed.

TriggerDispatchRecord.idempotency_token

idempotency_token str #

Dedup token derived from the matched event at the trigger’s once_per ({event.type}|{once_per}:{projection}).

TriggerDispatchRecord.org_id

org_id str #

Organization that owns the trigger.

TriggerDispatchRecord.result_ref

result_ref str | None = None #

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.

Return type: DispatchSlot

Attributes

TriggerDispatchRecord.status

Where this dispatch is in its lifecycle.

TriggerDispatchRecord.status_detail

status_detail str | None = None #

Human-readable detail for status, e.g. the error a failed target raised.

TriggerDispatchRecord.subject

subject str #

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_id

target_id str #

Which of the trigger’s targets this dispatch ran.

TriggerDispatchRecord.target_type

Kind of target dispatched.

TriggerDispatchRecord.trigger_id

trigger_id str #

Trigger this dispatch belongs to.

TriggerDispatchStatus

class roboto.domain.triggers.dispatch.TriggerDispatchStatus#View Source

Bases: roboto.compat.StrEnum

Lifecycle state of one dispatch: one attempt to run one target for one matched event.

Attributes

TriggerDispatchStatus.Claimed

Claimed = '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

Dispatched = 'dispatched' #

The target ran; TriggerDispatchRecord.result_ref points at what it produced.

TriggerDispatchStatus.Failed

Failed = 'failed' #

The target raised; a redelivered event may claim the slot again.

TriggerDispatchStatus.Unknown

Unknown = 'unknown' #

The claim outlived every redelivery of its event without finalizing, so the outcome cannot be determined. Set by an operational sweep, never reclaimable.

Was this page helpful?