pub struct ScheduledRunCtx {
pub schedule_id: String,
pub scheduled_at_ms: u64,
pub run_count: u64,
pub is_catchup: bool,
pub tenant_id: Option<String>,
pub site_id: Option<String>,
}Expand description
Context supplied to a single invocation of ScheduledPlugin::run.
Plain-data only — no framework types. The host populates this from its own clock and scheduler state; the plugin reads it to decide how to behave on catch-up runs, to emit tracing, etc.
Fields§
§schedule_id: StringThe Schedule::id being invoked. The plugin dispatches on this
when it owns more than one schedule.
scheduled_at_ms: u64Wall-clock time the scheduler decided to fire this run,
milliseconds since Unix epoch. May differ from “now” when the run
is a catch-up under MissedRunPolicy::RunAll.
run_count: u64Monotonic run counter since the scheduler started. Lets the plugin detect “first run after restart” (run_count == 1) without storing its own state.
is_catchup: booltrue if this run is catching up for a tick missed while the
host was down. false for normal on-time runs. Lets idempotent
jobs skip expensive work on catch-up.
tenant_id: Option<String>Tenant id the run is scoped to, if the plugin is installed under
a tenant. Matches the tenant_id on
crate::middleware::RequestContext for consistency.
site_id: Option<String>Site id the run is scoped to, if the plugin is installed under a site.
Trait Implementations§
Source§impl Clone for ScheduledRunCtx
impl Clone for ScheduledRunCtx
Source§fn clone(&self) -> ScheduledRunCtx
fn clone(&self) -> ScheduledRunCtx
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more