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§
Sourcefn 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 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.
Sourcefn activity_types(&self) -> BTreeSet<String>
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".