Skip to main content

Workflow

Trait Workflow 

Source
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§

Source

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§

Source

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.

Implementors§