pub struct ParallelFlow<C: Callable> { /* private fields */ }Expand description
Parallel execution flow
Implementations§
Source§impl<C: Callable + 'static> ParallelFlow<C>
impl<C: Callable + 'static> ParallelFlow<C>
Sourcepub fn add_branch(self, callable: Arc<C>) -> Self
pub fn add_branch(self, callable: Arc<C>) -> Self
Add a branch
Sourcepub fn with_fan_out(self, strategy: FanOut) -> Self
pub fn with_fan_out(self, strategy: FanOut) -> Self
Set fan-out strategy
Sourcepub fn with_fan_in(self, strategy: FanIn) -> Self
pub fn with_fan_in(self, strategy: FanIn) -> Self
Set fan-in strategy
Sourcepub async fn execute(&self, input: &str) -> Vec<ParallelResult>
pub async fn execute(&self, input: &str) -> Vec<ParallelResult>
Execute all branches in parallel
Sourcepub async fn execute_aggregated(&self, input: &str) -> Result<String>
pub async fn execute_aggregated(&self, input: &str) -> Result<String>
Execute and aggregate results
Sourcepub fn branch_count(&self) -> usize
pub fn branch_count(&self) -> usize
Get branch count
Auto Trait Implementations§
impl<C> Freeze for ParallelFlow<C>
impl<C> RefUnwindSafe for ParallelFlow<C>where
C: RefUnwindSafe,
impl<C> Send for ParallelFlow<C>
impl<C> Sync for ParallelFlow<C>
impl<C> Unpin for ParallelFlow<C>
impl<C> UnsafeUnpin for ParallelFlow<C>
impl<C> UnwindSafe for ParallelFlow<C>where
C: RefUnwindSafe,
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