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§
Sourcefn is_blocking(&self) -> bool
fn is_blocking(&self) -> bool
Returns true
if the scheduler is blocking.
Sourcefn time_till_next_job(&self) -> Option<Duration>
fn time_till_next_job(&self) -> Option<Duration>
Returns the duration till the next job is supposed to run.
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.
impl AsyncScheduler for Monitor
Available on crate feature
apalis
only.