pub struct BatchFlow<Context, ItemType, A = DefaultAction>where
Context: BatchContext<ItemType> + Send + Sync + 'static,
ItemType: Clone + Send + Sync + 'static,
A: ActionType + Clone + Send + Sync + 'static,{ /* private fields */ }Expand description
BatchFlow provides parallel processing of items from a context
Implementations§
Source§impl<Context, ItemType, A> BatchFlow<Context, ItemType, A>
impl<Context, ItemType, A> BatchFlow<Context, ItemType, A>
Sourcepub fn new(item_workflow: Workflow<Context, A>, parallelism: usize) -> Self
pub fn new(item_workflow: Workflow<Context, A>, parallelism: usize) -> Self
Create a new batch flow with the given item workflow
Sourcepub async fn execute(
&self,
ctx: &mut Context,
) -> Result<Vec<Result<ItemType, FloxideError>>, WorkflowError>
pub async fn execute( &self, ctx: &mut Context, ) -> Result<Vec<Result<ItemType, FloxideError>>, WorkflowError>
Execute the batch flow with the given context
Trait Implementations§
Auto Trait Implementations§
impl<Context, ItemType, A> Freeze for BatchFlow<Context, ItemType, A>
impl<Context, ItemType, A = DefaultAction> !RefUnwindSafe for BatchFlow<Context, ItemType, A>
impl<Context, ItemType, A> Send for BatchFlow<Context, ItemType, A>
impl<Context, ItemType, A> Sync for BatchFlow<Context, ItemType, A>
impl<Context, ItemType, A> Unpin for BatchFlow<Context, ItemType, A>
impl<Context, ItemType, A = DefaultAction> !UnwindSafe for BatchFlow<Context, ItemType, A>
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