Skip to main content

Module history_cache

Module history_cache 

Source
Expand description

HistoryCache — ordered sample storage for reliable writer/reader.

DDSI-RTPS 2.5 §8.4.8. Both sides (writer + reader) hold their own cache instance:

  • Writer cache: CacheChanges stored via write(), from which re-sends happen on AckNack request. Removes samples only once all matched readers have confirmed them via AckNack.
  • Reader cache: received CacheChanges in SN order, for in-order delivery to the application layer. Can be cleared via remove_up_to after delivery.

History QoS (WP 1.4 T3 follow-up): the cache is configured via HistoryKindKeepAll (hard-bounded, error on overflow) vs. KeepLast(depth) (ring buffer, the oldest sample drops out on overflow). KeepLast is spec-conformant (§8.7.4) and decouples writer-cache GC from reader-ACKNACK progress — a stalled reader thereby no longer prevents other readers from getting further samples (“per-destination queue” model).

Structs§

CacheChange
Single cache entry.
HistoryCache
Ordered sample storage.
HistoryCacheSnapshot
Plain-old-data snapshot of the HistoryCache statistics at a single point in time. Produced by HistoryCacheStats::snapshot; each component is loaded with Acquire ordering.
HistoryCacheStats
Atomically updated snapshot statistics of a HistoryCache.
LockFreeInner
Inner state of the LockFreeReadHistoryCache. Handed out by LockFreeReadHistoryCache::snapshot as an Arc<LockFreeInner> — readers iterate over changes directly.
LockFreeReadHistoryCache
HistoryCache variant with a lock-free read path via RCU/copy-on-write.

Enums§

CacheError
Error variants for cache operations.
ChangeKind
Kind of a cache entry (DDSI-RTPS §8.2.1.2 / §8.7.2.2.2).
HistoryKind
History-QoS (DDSI-RTPS §8.7.4, Spec Table 17).