pub enum Schedule {
Interval(Duration),
StaggeredInterval(StaggeredIntervalSchedule),
GroupedInterval(GroupedIntervalSchedule),
WindowedInterval(WindowedIntervalSchedule),
AtTimes(Vec<DateTime<Tz>>),
Cron(CronSchedule),
}Variants§
Interval(Duration)
Trigger repeatedly after the given interval.
StaggeredInterval(StaggeredIntervalSchedule)
Trigger repeatedly after the given interval with a stable phase.
The first run is aligned to a deterministic phase derived from the seed. If no seed is provided, the job id is used.
GroupedInterval(GroupedIntervalSchedule)
Trigger repeatedly after the given interval with evenly spaced group members.
The first run is aligned to a stable slot determined by the member index. An optional group seed can rotate the entire group without changing the spacing between members.
WindowedInterval(WindowedIntervalSchedule)
Trigger repeatedly with frequencies selected by local time windows.
AtTimes(Vec<DateTime<Tz>>)
Trigger at the listed wall-clock times.
The list is sorted before execution starts. An empty list is treated as a no-op schedule and exits without running.
Cron(CronSchedule)
Trigger using a standard 5-field cron expression.
The scheduler timezone is used to calculate the next matching wall-clock time. The expression itself does not carry timezone information.
Implementations§
Source§impl Schedule
impl Schedule
Sourcepub fn staggered_interval(every: Duration) -> Self
pub fn staggered_interval(every: Duration) -> Self
Create a staggered interval schedule that defaults to the job id as the phase seed.
Sourcepub fn staggered_interval_with_seed(
every: Duration,
seed: impl Into<String>,
) -> Self
pub fn staggered_interval_with_seed( every: Duration, seed: impl Into<String>, ) -> Self
Create a staggered interval schedule with an explicit phase seed.
Sourcepub fn grouped_interval(
every: Duration,
group_size: u32,
member_index: u32,
) -> Self
pub fn grouped_interval( every: Duration, group_size: u32, member_index: u32, ) -> Self
Create a grouped interval schedule with evenly spaced members.
Sourcepub fn grouped_interval_with_seed(
every: Duration,
group_size: u32,
member_index: u32,
group_seed: impl Into<String>,
) -> Self
pub fn grouped_interval_with_seed( every: Duration, group_size: u32, member_index: u32, group_seed: impl Into<String>, ) -> Self
Create a grouped interval schedule and rotate the whole group with an explicit seed.
Sourcepub fn windowed_interval(default_every: Option<Duration>) -> Self
pub fn windowed_interval(default_every: Option<Duration>) -> Self
Create a windowed interval schedule.