pub struct ThresholdBatchProcessor<T> { /* private fields */ }
Expand description
Threshold-based batch processor
Implementations§
Source§impl<T> ThresholdBatchProcessor<T>
impl<T> ThresholdBatchProcessor<T>
Sourcepub fn new<F>(config: BatchConfig, processor: F) -> Self
pub fn new<F>(config: BatchConfig, processor: F) -> Self
Create new threshold batch processor
Sourcepub fn with_default_config<F>(processor: F) -> Self
pub fn with_default_config<F>(processor: F) -> Self
Create with default medium frequency configuration
Sourcepub fn flush_batch(&self)
pub fn flush_batch(&self)
Flush the current batch
Sourcepub fn current_frequency(&self) -> u64
pub fn current_frequency(&self) -> u64
Get current frequency (operations per second)
Sourcepub fn is_batching_enabled(&self) -> bool
pub fn is_batching_enabled(&self) -> bool
Check if batching is currently enabled
Sourcepub fn stats(&self) -> ProcessingStats
pub fn stats(&self) -> ProcessingStats
Get processing statistics
Sourcepub fn reset_stats(&self)
pub fn reset_stats(&self)
Reset all statistics
Trait Implementations§
impl<T: Send> Send for ThresholdBatchProcessor<T>
impl<T: Send> Sync for ThresholdBatchProcessor<T>
Auto Trait Implementations§
impl<T> !Freeze for ThresholdBatchProcessor<T>
impl<T> !RefUnwindSafe for ThresholdBatchProcessor<T>
impl<T> Unpin for ThresholdBatchProcessor<T>where
T: Unpin,
impl<T> !UnwindSafe for ThresholdBatchProcessor<T>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more