pub struct DynamicBatcher<T> { /* private fields */ }Expand description
Dynamic batching manager that optimizes batch sizes based on performance
Implementations§
Source§impl<T> DynamicBatcher<T>
impl<T> DynamicBatcher<T>
Sourcepub fn new(config: DynamicBatchingConfig) -> Self
pub fn new(config: DynamicBatchingConfig) -> Self
Create a new dynamic batcher with configuration
Sourcepub async fn add_request(
&self,
input: T,
priority: RequestPriority,
) -> Result<T>
pub async fn add_request( &self, input: T, priority: RequestPriority, ) -> Result<T>
Add a request to the batching queue
Sourcepub async fn start<F, Fut>(&self, process_batch: F) -> Result<()>
pub async fn start<F, Fut>(&self, process_batch: F) -> Result<()>
Start the dynamic batching process
Sourcepub fn get_performance_stats(&self) -> Option<BatchingStats>
pub fn get_performance_stats(&self) -> Option<BatchingStats>
Get current performance statistics
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for DynamicBatcher<T>
impl<T> RefUnwindSafe for DynamicBatcher<T>
impl<T> Send for DynamicBatcher<T>
impl<T> Sync for DynamicBatcher<T>
impl<T> Unpin for DynamicBatcher<T>
impl<T> UnsafeUnpin for DynamicBatcher<T>
impl<T> UnwindSafe for DynamicBatcher<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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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