pub trait Timer {
    // Required method
    fn timeout<'life0, 'async_trait, F>(
        &'life0 self,
        duration: Duration,
        future: F
    ) -> Pin<Box<dyn Future<Output = Result<<F as Future>::Output, ()>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             F: Future + Send + Sync + 'async_trait,
             Self: 'async_trait;
}
Expand description

Allows memory storage to set timeouts for when to retry checking a queue for a job

Required Methods§

source

fn timeout<'life0, 'async_trait, F>( &'life0 self, duration: Duration, future: F ) -> Pin<Box<dyn Future<Output = Result<<F as Future>::Output, ()>> + Send + 'async_trait>>
where 'life0: 'async_trait, F: Future + Send + Sync + 'async_trait, Self: 'async_trait,

Race a future against the clock, returning an empty tuple if the clock wins

Object Safety§

This trait is not object safe.

Implementors§