Trait AsyncScheduler

Source
pub trait AsyncScheduler {
    // Required methods
    fn is_ready(&self) -> bool;
    fn is_blocking(&self) -> bool;
    fn time_till_next_job(&self) -> Option<Duration>;
    fn tick(&mut self) -> impl Future<Output = ()> + Send;
    fn run(self) -> impl Future<Output = Result<()>> + Send;
}
Expand description

An interface for scheduling async jobs.

Required Methods§

Source

fn is_ready(&self) -> bool

Returns true if the scheduler is ready to run.

Source

fn is_blocking(&self) -> bool

Returns true if the scheduler is blocking.

Source

fn time_till_next_job(&self) -> Option<Duration>

Returns the duration till the next job is supposed to run.

Source

fn tick(&mut self) -> impl Future<Output = ()> + Send

Increments time for the scheduler and executes any pending jobs asynchronously.

Source

fn run(self) -> impl Future<Output = Result<()>> + Send

Runs the scheduler and returns an std::io::Error if failed.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl AsyncScheduler for Monitor

Available on crate feature apalis only.
Source§

fn is_ready(&self) -> bool

Source§

fn is_blocking(&self) -> bool

Source§

fn time_till_next_job(&self) -> Option<Duration>

Source§

async fn tick(&mut self)

Source§

async fn run(self) -> Result<()>

Implementors§