#[non_exhaustive]pub enum BatchingPolicy {
Immediate,
Size,
Duration(Duration, OnFull),
}Expand description
A policy controlling when batches get processed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Immediate
Immediately process the batch if possible.
When concurrency is available, new items will be processed immediately (with a batch size of one).
When concurrency is maximised, new items will added to the next batch (up to the maximum batch size). As soon as a batch finishes the next batch will start. When concurrency is limited to 1, it will run batches serially.
Prioritises low latency.
Size
Process the batch when it reaches the maximum size.
Prioritises high batch utilisation.
Duration(Duration, OnFull)
Process the batch a given duration after it was created.
Prioritises regularity.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BatchingPolicy
impl RefUnwindSafe for BatchingPolicy
impl Send for BatchingPolicy
impl Sync for BatchingPolicy
impl Unpin for BatchingPolicy
impl UnwindSafe for BatchingPolicy
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