pub trait PendingHandler {
    type Envelope: Send;

    const MAX_PENDING: usize;

    // Required method
    fn process_pending<'life0, 'async_trait>(
        &'life0 mut self,
        envelope: Self::Envelope
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<(), HandlerError>> + Send>>, HandlerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Handle event envelopes in any way that an application requires.

Required Associated Types§

source

type Envelope: Send

The envelope processed by the handler.

Required Associated Constants§

source

const MAX_PENDING: usize

The maximum number of envelopes that can be pending at any time.

Required Methods§

source

fn process_pending<'life0, 'async_trait>( &'life0 mut self, envelope: Self::Envelope ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<(), HandlerError>> + Send>>, HandlerError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Process an envelope with a pending result. A handler’s result is “pending” when envelopes can be passed through and the result of processing one is not immediately known. Meanwhile, more envelopes can be passed though.

Object Safety§

This trait is not object safe.

Implementors§