Skip to main content

ActivityDispatcher

Trait ActivityDispatcher 

Source
pub trait ActivityDispatcher:
    Send
    + Sync
    + 'static {
    // Required methods
    fn dispatch<'life0, 'async_trait>(
        &'life0 self,
        task: ActivityTask,
        context: ActivityContext,
    ) -> Pin<Box<dyn Future<Output = Result<DispatchOutcome, WorkerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn activity_types(&self) -> BTreeSet<String>;
}
Expand description

Dispatch seam used by the receive loop to execute decoded activity tasks.

Required Methods§

Source

fn dispatch<'life0, 'async_trait>( &'life0 self, task: ActivityTask, context: ActivityContext, ) -> Pin<Box<dyn Future<Output = Result<DispatchOutcome, WorkerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Executes one decoded activity task with the provided handler context.

Source

fn activity_types(&self) -> BTreeSet<String>

Activity type names this dispatcher can serve.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§