Skip to main content

Module buffer

Module buffer 

Source
Expand description

Offline buffer / store-and-forward for resilience (CLS-09).

When an edge device loses connectivity it can push signed AuditRecords into an OfflineBuffer. When the link recovers the caller calls OfflineBuffer::flush which replays the buffered records through an IngestService in the original order and reports how many were accepted.

§Pluggable storage

BufferStore is a synchronous trait. The default implementation is InMemoryBufferStore (volatile, useful for tests and embedded environments with no persistent storage). An optional SQLite-backed store is available behind the buffer-sqlite feature flag ([SqliteBufferStore]).

§Flush semantics

Records are replayed oldest-first. A record that returns [IngestServiceError::Verify(IngestError::Duplicate)] is treated as “already delivered” and counted as accepted. Any other error stops the flush at that point and the remaining records stay in the buffer.

Structs§

BufferedEntry
A single entry in the offline buffer.
FlushReport
Report returned by OfflineBuffer::flush.
InMemoryBufferStore
Volatile in-memory implementation of BufferStore. Entries are lost on drop.
InMemoryBufferStoreError
OfflineBuffer
A store-and-forward buffer that accumulates signed AuditRecords during connectivity loss and replays them in order when the link recovers.

Enums§

FlushError
Error returned by OfflineBuffer::flush.

Traits§

BufferStore
Pluggable persistent / volatile storage for OfflineBuffer.