pub struct ParallelFlow { /* private fields */ }Expand description
Fan-out the input to N branches, run them concurrently, return a JSON object keyed by branch name. First error fails the whole flow (other branches are dropped).
Implementations§
Source§impl ParallelFlow
impl ParallelFlow
Sourcepub fn branch(self, key: impl Into<String>, flow: Arc<dyn Flow>) -> Self
pub fn branch(self, key: impl Into<String>, flow: Arc<dyn Flow>) -> Self
Append a branch. The key becomes the JSON key in the output object.
Duplicate keys overwrite — caller must ensure uniqueness.
Sourcepub fn branch_agent<A>(self, key: impl Into<String>, agent: A) -> Selfwhere
A: Agent + 'static,
pub fn branch_agent<A>(self, key: impl Into<String>, agent: A) -> Selfwhere
A: Agent + 'static,
Convenience builder that wraps a concrete klieo_core::agent::Agent
in crate::flow::AgentFlow + upcasts to Arc<dyn Flow> in one
call. The key becomes the JSON key in the output object.
Trait Implementations§
Source§impl Flow for ParallelFlow
impl Flow for ParallelFlow
Auto Trait Implementations§
impl !RefUnwindSafe for ParallelFlow
impl !UnwindSafe for ParallelFlow
impl Freeze for ParallelFlow
impl Send for ParallelFlow
impl Sync for ParallelFlow
impl Unpin for ParallelFlow
impl UnsafeUnpin for ParallelFlow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more