Skip to main content

FutureQueueConsumer

Trait FutureQueueConsumer 

Source
pub trait FutureQueueConsumer: Send + Sync {
    // Required methods
    fn on_items_due<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn on_error<'life0, 'async_trait>(
        &'life0 self,
        error: Box<dyn Error + Send + Sync>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn now(&self) -> u64;
}

Required Methods§

Source

fn on_items_due<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when the polling loop determines items are due. The consumer is responsible for calling ContinuousQuery::process_due_futures() internally, which atomically pops and processes within a session.

Source

fn on_error<'life0, 'async_trait>( &'life0 self, error: Box<dyn Error + Send + Sync>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when on_items_due returns an error.

Source

fn now(&self) -> u64

Returns the current time in milliseconds since epoch. Retained so tests can override the clock via AutoFutureQueueConsumer::with_now_override().

Implementors§