Skip to main content

Recurring

Struct Recurring 

Source
pub struct Recurring<P> { /* private fields */ }
Expand description

A recurring (cron) schedule.

Implementations§

Source§

impl<P> Recurring<P>

Source

pub fn new( name: impl Into<Arc<str>>, cron: impl Into<Arc<str>>, template: Task<P>, ) -> Self

cron accepts 5 fields, or 6 with leading seconds.

The template supplies payload, pool, kind, priority, resources, retry, timeout and tags for every occurrence, and optionally:

Absolute deadlines, fixed starts and dependencies describe a single task and are rejected by Scheduler::add_recurring; to run occurrences one after another, use OverlapPolicy::Queue. Each occurrence starts at its cron time with Recurring::tolerance and Recurring::on_miss.

Source

pub fn tz(self, tz: impl Into<Arc<str>>) -> Self

IANA time zone, e.g. Europe/Lisbon (default UTC).

Source

pub fn overlap(self, o: OverlapPolicy) -> Self

What happens while the previous occurrence is still live: skip (default), allow overlap, or queue behind it (OverlapPolicy::Queue, OverlapPolicy::QueueOnSuccess).

Source

pub fn tolerance(self, d: Duration) -> Self

How late an occurrence may start and still count as on time.

Source

pub fn on_miss(self, p: MissPolicy) -> Self

What to do with an occurrence that missed its start.

Trait Implementations§

Source§

impl<P: Debug> Debug for Recurring<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<P> Freeze for Recurring<P>

§

impl<P> RefUnwindSafe for Recurring<P>

§

impl<P> Send for Recurring<P>
where RecurringSpec<P>: Send,

§

impl<P> Sync for Recurring<P>
where RecurringSpec<P>: Sync,

§

impl<P> Unpin for Recurring<P>
where RecurringSpec<P>: Unpin,

§

impl<P> UnsafeUnpin for Recurring<P>

§

impl<P> UnwindSafe for Recurring<P>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more