pub struct RequestBatcher { /* private fields */ }Expand description
Request batcher for a module.
Implementations§
Source§impl RequestBatcher
impl RequestBatcher
Sourcepub fn new(module_name: String, config: BatchConfig) -> Self
pub fn new(module_name: String, config: BatchConfig) -> Self
Creates a new request batcher.
Sourcepub async fn queue(&self, request: BatchedRequest) -> Result<(), String>
pub async fn queue(&self, request: BatchedRequest) -> Result<(), String>
Queues a request for batching.
Sourcepub fn take_receiver(&self) -> Option<Receiver<RequestBatch>>
pub fn take_receiver(&self) -> Option<Receiver<RequestBatch>>
Returns the batch receiver for consumption.
Sourcepub fn stats(&self) -> BatchStats
pub fn stats(&self) -> BatchStats
Returns statistics.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RequestBatcher
impl !RefUnwindSafe for RequestBatcher
impl Send for RequestBatcher
impl Sync for RequestBatcher
impl Unpin for RequestBatcher
impl UnsafeUnpin for RequestBatcher
impl UnwindSafe for RequestBatcher
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