Skip to main content

ExecutableAsyncSignal

Trait ExecutableAsyncSignal 

Source
pub trait ExecutableAsyncSignal<S>: WorkflowImplementation{
    // Required method
    fn handle(
        ctx: WorkflowContext<Self>,
        input: <S as SignalDefinition>::Input,
    ) -> Pin<Box<dyn Future<Output = ()>>>;

    // Provided method
    fn dispatch(
        ctx: WorkflowContext<Self>,
        input: Box<dyn Any>,
    ) -> Pin<Box<dyn Future<Output = Result<(), WorkflowError>>>> { ... }
}
Expand description

Trait for executing asynchronous signal handlers on a workflow.

Required Methods§

Source

fn handle( ctx: WorkflowContext<Self>, input: <S as SignalDefinition>::Input, ) -> Pin<Box<dyn Future<Output = ()>>>

Handle an incoming signal with the given input.

Provided Methods§

Source

fn dispatch( ctx: WorkflowContext<Self>, input: Box<dyn Any>, ) -> Pin<Box<dyn Future<Output = Result<(), WorkflowError>>>>

Dispatch the signal with an already decoded input.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§