benjamin_batchly crates.io Documentation

Low latency batching tool. Bundle lots of single concurrent operations into sequential batches of work.

```rust use benjamin_batchly::{BatchMutex, BatchResult};

let batcher = BatchMutex::default();

// BatchMutex synchronizes so only one Work happens at a time (for a given batchkey). // All concurrent submissions made while an existing Work is being processed will // await completion and form the next Work batch. match batcher.submit(batchkey, item).await { BatchResult::Work(mut batch) => { dbbulkinsert(&batch.items).await?; batch.notifyalldone(); Ok(()) } BatchResult::Done(_) => Ok(()), BatchResult::Failed => Err("failed"), } ```