pub struct AsyncCommandBatcher { /* private fields */ }Expand description
Async command batcher for concurrent scenarios
Implementations§
Source§impl AsyncCommandBatcher
impl AsyncCommandBatcher
pub fn new(config: BatchConfig) -> Self
Sourcepub fn add_command(&self, command: Command) -> Result<()>
pub fn add_command(&self, command: Command) -> Result<()>
Add a command for batching
Sourcepub async fn next_batch(&mut self) -> Option<CommandBatch>
pub async fn next_batch(&mut self) -> Option<CommandBatch>
Receive next batch (blocking)
Sourcepub fn try_next_batch(&mut self) -> Option<CommandBatch>
pub fn try_next_batch(&mut self) -> Option<CommandBatch>
Try to receive a batch without blocking
Sourcepub async fn next_batch_timeout(
&mut self,
duration: Duration,
) -> Result<CommandBatch>
pub async fn next_batch_timeout( &mut self, duration: Duration, ) -> Result<CommandBatch>
Receive next batch with timeout
Auto Trait Implementations§
impl Forget for AsyncCommandBatcher
impl Freeze for AsyncCommandBatcher
impl Move for AsyncCommandBatcher
impl RefUnwindSafe for AsyncCommandBatcher
impl Send for AsyncCommandBatcher
impl Sync for AsyncCommandBatcher
impl Unpin for AsyncCommandBatcher
impl UnsafeUnpin for AsyncCommandBatcher
impl UnwindSafe for AsyncCommandBatcher
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