pub enum Trigger {
None,
Cron {
expression: String,
timezone: String,
catchup: bool,
start: Option<Timestamp>,
end: Option<Timestamp>,
},
Every {
interval_ms: u64,
catchup: bool,
start: Option<Timestamp>,
end: Option<Timestamp>,
},
Once {
at: Timestamp,
},
Event {
task: Box<Task>,
restart_if_idle_ms: Option<u64>,
start: Option<Timestamp>,
end: Option<Timestamp>,
run_retries: Option<u32>,
},
RunOf {
run_of: RunOf,
},
Chained {
by: Option<Vec<DagId>>,
},
EventNamed {
event: EventNamed,
},
}Expand description
What starts runs of a DAG besides people.
Variants§
None
Nothing: manual runs only (the DAG is switched off but for those).
Cron
A cron expression (5 or 6 fields, or a preset such as @daily) evaluated in a time zone.
Fields
Every
A fixed interval measured in real time (UTC), unaffected by daylight saving.
Fields
interval_ms: u64The interval in milliseconds; fire times are whole intervals from start, or from
the Unix epoch without one.
Once
A single fire time (it has no previous fire time).
Fields
at: TimestampThe fire time.
Event
A @trigger function, which runs in a worker’s watcher host and yields events: each new
one starts a run.
Fields
task: Box<Task>Its function as a task of kind sensor: its literal arguments, whether it is called
every so often, its queue, its secrets and connections. It isn’t in the graph.
RunOf
trigger=RunOf(...) (decision 353): a run per run of another DAG (or its task) that
succeeded while this one is live, planned for that run’s planned_for plus lag, or for
the moment the master saw it.
Chained
trigger=Chained() (decision 398): only other DAGs’ TriggerDagOperators start its
runs (and people, by hand); the scheduler never does.
EventNamed
trigger=EventNamed(...) (decision 354): a run per event of that name posted through the
API while this DAG is live, keyed by the event’s key, planned for its at.
Fields
event: EventNamedWhich events: its name (a trigger takes no key).
Implementations§
Source§impl Trigger
impl Trigger
Sourcepub const fn kind(&self) -> Option<&'static str>
pub const fn kind(&self) -> Option<&'static str>
Its kind as the UI names it and dag_triggers.kind stores it (decision 459):
schedule (cron, every, once), run_of, chained or event (by a trigger or by name);
None for no trigger. A change of kind pauses it; another trigger of the same kind
keeps its switch.
Sourcepub const fn is_manual_only(&self) -> bool
pub const fn is_manual_only(&self) -> bool
Whether the scheduler never creates runs: only people (or other DAGs) do.
Sourcepub fn chained_from(&self, dag: &DagId) -> bool
pub fn chained_from(&self, dag: &DagId) -> bool
Whether dag may start its runs with a TriggerDagOperator (decision 398): it is
Chained, for any DAG or one of those it names.
Sourcepub const fn is_run_of(&self) -> bool
pub const fn is_run_of(&self) -> bool
Whether another DAG’s runs start its runs (trigger=RunOf(...)).
Sourcepub const fn brings_event(&self) -> bool
pub const fn brings_event(&self) -> bool
Whether its runs bring an event: a @trigger’s, or the run of another DAG that started
it (RunOf).
Sourcepub const fn catchup(&self) -> bool
pub const fn catchup(&self) -> bool
Whether missed fire times get runs in order; false for triggers without catchup
(a single fire time has nothing to catch up on).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Trigger
impl<'de> Deserialize<'de> for Trigger
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Trigger
Source§impl JsonSchema for Trigger
impl JsonSchema for Trigger
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more