pub trait WorkflowRunner: Send + Sync {
// Required method
fn run<'w, C, Input, M>(
&self,
workflow: &'w Workflow<C, Input, M>,
input: Input,
) -> impl Future<Output = Result<WorkflowStatus, RuntimeError>> + Send + 'w
where Input: Send + 'static,
M: Send + Sync + 'static,
C: Codec + EncodeValue<Input>;
}Expand description
A trait for executing workflows.
Different implementations can provide different execution strategies, such as in-process execution, distributed execution, or execution with persistence and recovery.
Note: This trait uses impl Future which makes it non-object-safe.
If you need dynamic dispatch, wrap implementations in an enum.
Required Methods§
Sourcefn run<'w, C, Input, M>(
&self,
workflow: &'w Workflow<C, Input, M>,
input: Input,
) -> impl Future<Output = Result<WorkflowStatus, RuntimeError>> + Send + 'w
fn run<'w, C, Input, M>( &self, workflow: &'w Workflow<C, Input, M>, input: Input, ) -> impl Future<Output = Result<WorkflowStatus, RuntimeError>> + Send + 'w
Run a workflow with the given input.
The input type must match the input type of the first task added via then.
Returns the workflow execution status.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.