roboto.domain.triggers.sources
What makes a trigger fire: a platform event subscription or a schedule.
A trigger has exactly one firing source. Both kinds feed the same condition and the same targets, and a target cannot tell which one fired it beyond what the event namespace exposes.
Module Contents
EventSubscription
Bases: _SourceBase
Fire when any of the subscribed platform events occurs.
Carries once_per because it only means something here: it names what the event is about that the trigger fires at most once for, and a schedule has no such subject.
Parameters
data AnyAttributes
EventSubscription.events
Event types the trigger subscribes to. At least one; a condition may only reference namespace roots exposed by every subscribed event.
EventSubscription.fires_for()
Return whether an event of event_type is one this subscription fires for.
Parameters
Return type
Attributes
EventSubscription.once_per
What the trigger fires at most once per: the occurrence, or an entity the event names. Must be legal for every subscribed event type.
Schedule
Bases: _SourceBase
Fire on a cron schedule, in UTC.
Each scheduled minute fires the trigger once (once_per='occurrence' over the schedule tick). A missed minute is skipped rather than replayed later, so a delayed schedule never floods targets with backdated firings. Cron expressions are evaluated in UTC; a schedule cannot name a time zone.
Parameters
data AnyAttributes
Schedule.cron
A five-field cron expression (minute hour day-of-month month day-of-week), evaluated in UTC — e.g. 0 9 * * 1 for 09:00 UTC every Monday.
Schedule.fires_for()
Return whether event_type is the schedule occurrence this source fires for.
Parameters
Return type
Properties
Schedule.once_per
A schedule always fires once per scheduled minute.
Attributes
TriggerSource
A trigger’s firing source, discriminated on type.
TriggerSourceType
Bases: roboto.compat.StrEnum
Discriminator for TriggerSource.