Skip to main content

QueueHandler

Trait QueueHandler 

Source
pub trait QueueHandler:
    Send
    + Sync
    + 'static {
    // Required method
    fn handle(
        &self,
        batch: MessageBatch<String>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'static>>;
}
Expand description

Trait for queue message handlers.

Implemented automatically for async functions with the signature: async fn(MessageBatch<String>) -> worker::Result<()>

Required Methods§

Source

fn handle( &self, batch: MessageBatch<String>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'static>>

Implementors§

Source§

impl<F, Fut> QueueHandler for F
where F: Fn(MessageBatch<String>) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<()>> + Send + 'static,

Blanket implementation for async functions.