pub trait Workflow: Send + Sync {
// Required method
fn run<'a>(
&'a mut self,
input: &'a str,
) -> Pin<Box<dyn Future<Output = Result<WorkflowOutput, ReactError>> + Send + 'a>>;
// Provided method
fn run_stream<'a>(
&'a mut self,
input: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<WorkflowEvent, ReactError>> + Send + 'a>>, ReactError>> + Send + 'a>> { ... }
}Expand description
Unified workflow execution interface
Required Methods§
Sourcefn run<'a>(
&'a mut self,
input: &'a str,
) -> Pin<Box<dyn Future<Output = Result<WorkflowOutput, ReactError>> + Send + 'a>>
fn run<'a>( &'a mut self, input: &'a str, ) -> Pin<Box<dyn Future<Output = Result<WorkflowOutput, ReactError>> + Send + 'a>>
Run the entire workflow with input as the initial input
Provided Methods§
Sourcefn run_stream<'a>(
&'a mut self,
input: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<WorkflowEvent, ReactError>> + Send + 'a>>, ReactError>> + Send + 'a>>
fn run_stream<'a>( &'a mut self, input: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<WorkflowEvent, ReactError>> + Send + 'a>>, ReactError>> + Send + 'a>>
Run the entire workflow with input as initial input (streaming per-node events).
Default implementation falls back to run() and only emits the Completed event.