Skip to main content

Module queue

Module queue 

Source
Expand description

Event queue — EventQueue trait + two impls.

Adapters that buffer events for later transmission depend on the EventQueue trait so the choice of in-memory vs. persistent backing is a deployment detail. Both impls have the same FIFO semantics (oldest event drained first); only PersistentEventQueue survives process restart.

  • InMemoryEventQueueMutex<VecDeque<OwnedEvent>>. Default for tests and for adapters that consider events ephemeral.
  • PersistentEventQueue — backed by redb at a path under AppPaths::data_dir(). Pure-Rust, no C deps, ~250–400 KB binary footprint vs. SQLite’s ~1 MB. Atomic writes, MVCC reads, single-writer.

Structs§

InMemoryEventQueue
Bounded FIFO event buffer with Send + Sync access.
PersistentEventQueue
redb-backed event queue. Send + Sync — internal Mutex wraps the Database handle so adapter UI-thread pushes and worker- thread drains don’t conflict.

Enums§

PersistentQueueError

Traits§

EventQueue
FIFO event buffer with capped size and oldest-eviction.