Expand description
A thread-safe, dynamically resizable circular buffer implementation.
This buffer is designed for high-throughput scenarios, particularly suitable for use in MQTT proxy applications where efficient message buffering is critical.
§Features
- Default: Lock-based circular buffer with dynamic resizing
async: Async/await support with Tokiolock_free: Lock-free MPSC queue for high-throughput scenariospriority: Priority queue with configurable levels (great for MQTT QoS)streams: Async Stream and Sink integrationpersistent: Durable buffer with crash recoverymetrics: Prometheus-compatible metrics and observability
§Example
use elasticq::{DynamicCircularBuffer, Config};
let buffer = DynamicCircularBuffer::<i32>::new(Config::default()).unwrap();
buffer.push(42).unwrap();
assert_eq!(buffer.pop().unwrap(), 42);Structs§
- Config
- Dynamic
Circular Buffer - The main struct representing the dynamic circular buffer.
Enums§
Type Aliases§
- Buffer
Result - Thread
Safe Dynamic Circular Buffer - A thread-safe wrapper around
DynamicCircularBuffer.