pub struct Batcher<P: Processor> { /* private fields */ }Expand description
Groups items to be processed in batches.
Takes inputs one at a time and sends them to a background worker task which groups them into
batches according to the specified BatchingPolicy and Limits, and processes them using
the provided Processor.
Cheap to clone. Cloned instances share the same background worker task.
§Drop
When the last instance of a Batcher is dropped, the worker task will be aborted (ungracefully
shut down).
If you want to shut down the worker gracefully, call WorkerHandle::shut_down().
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for Batcher<P>
impl<P> RefUnwindSafe for Batcher<P>
impl<P> Send for Batcher<P>
impl<P> Sync for Batcher<P>
impl<P> Unpin for Batcher<P>
impl<P> UnwindSafe for Batcher<P>
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