pub struct CronRunner { /* private fields */ }Implementations§
Source§impl CronRunner
impl CronRunner
pub fn new( store: Arc<dyn CronStore>, dispatcher: Arc<dyn CronDispatcher>, ) -> Self
pub fn with_tick_interval(self, interval: Duration) -> Self
pub fn with_one_shot_retry_policy(self, policy: OneShotRetryPolicy) -> Self
Sourcepub fn with_jitter_pct(self, pct: u32) -> Self
pub fn with_jitter_pct(self, pct: u32) -> Self
Backward-compat shim — pct (0..=100) maps to a fresh
CronJitterConfig with recurring_frac = pct / 100.0.
New callers should pass a hot-reloaded
Arc<ArcSwap<CronJitterConfig>> via Self::with_jitter_cfg.
Sourcepub fn with_jitter_cfg(self, cfg: Arc<ArcSwap<CronJitterConfig>>) -> Self
pub fn with_jitter_cfg(self, cfg: Arc<ArcSwap<CronJitterConfig>>) -> Self
Wire a hot-reloaded jitter config.
Sourcepub async fn tick_once(&self, now_unix: i64) -> Vec<FireOutcome>
pub async fn tick_once(&self, now_unix: i64) -> Vec<FireOutcome>
Run a single tick at now_unix and advance state. Returns
one outcome per entry that was due. Test-friendly.
Sourcepub async fn run(self: Arc<Self>, cancel: CancellationToken)
pub async fn run(self: Arc<Self>, cancel: CancellationToken)
Run forever (until cancel fires). Production wiring
spawns this on a tokio task.
Auto Trait Implementations§
impl !RefUnwindSafe for CronRunner
impl !UnwindSafe for CronRunner
impl Freeze for CronRunner
impl Send for CronRunner
impl Sync for CronRunner
impl Unpin for CronRunner
impl UnsafeUnpin for CronRunner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more