Skip to main content

ExecutableAsyncUpdate

Trait ExecutableAsyncUpdate 

Source
pub trait ExecutableAsyncUpdate<U: UpdateDefinition>: WorkflowImplementation {
    // Required method
    fn handle(
        ctx: WorkflowContext<Self>,
        input: U::Input,
    ) -> LocalBoxFuture<'static, Result<U::Output, Box<dyn Error + Send + Sync>>>;

    // Provided methods
    fn validate(
        &self,
        _ctx: &WorkflowContextView,
        _input: &U::Input,
    ) -> Result<(), Box<dyn Error + Send + Sync>> { ... }
    fn dispatch(
        ctx: WorkflowContext<Self>,
        input: Box<dyn Any>,
        converter: &PayloadConverter,
    ) -> LocalBoxFuture<'static, Result<Payload, WorkflowError>> { ... }
    fn dispatch_validate(
        &self,
        ctx: &WorkflowContextView,
        input: Box<dyn Any>,
    ) -> Result<(), WorkflowError> { ... }
}
Expand description

Trait for executing asynchronous update handlers on a workflow.

Required Methods§

Source

fn handle( ctx: WorkflowContext<Self>, input: U::Input, ) -> LocalBoxFuture<'static, Result<U::Output, Box<dyn Error + Send + Sync>>>

Handle an update with the given input and return the result.

Provided Methods§

Source

fn validate( &self, _ctx: &WorkflowContextView, _input: &U::Input, ) -> Result<(), Box<dyn Error + Send + Sync>>

Validate an update before it is applied.

Source

fn dispatch( ctx: WorkflowContext<Self>, input: Box<dyn Any>, converter: &PayloadConverter, ) -> LocalBoxFuture<'static, Result<Payload, WorkflowError>>

Dispatch the update with an already decoded input.

Source

fn dispatch_validate( &self, ctx: &WorkflowContextView, input: Box<dyn Any>, ) -> Result<(), WorkflowError>

Dispatch validation 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§