Expand description
Payload-offload decorator for CacheRepository backends, with a
pluggable PayloadStore.
OffloadRepository wraps any backend (the “index”) and moves entry
payloads into a PayloadStore (local disk, redis, …), storing only
the store-side blob name in the index row. Index rows stay small; the
payload is re-injected on get/peek_stale.
§Blob lifecycle
Blob names are {blake3-128hex(key)}.{death_epoch_secs}.{blake3-128hex( bytes || content_type-discriminant)}.blob. The death epoch —
expires_at + stale_retention + sweep_interval — is encoded in the
name so store-side reclaimers can reclaim dead payloads by name alone,
without consulting the index.
§Failure policy
- A payload put that fails falls back to storing the entry inline in
the index (WARN +
inner.setwith the original entry): the decorator never converts a store failure into a cache-writeErr. - A vanished or corrupt blob row degrades to a miss (
Ok(None)+ WARN). - A payload that exists but cannot be read (e.g.
PermissionDenied) surfaces asErrper ADR-0023 Contract C1.
Structs§
- Offload
Repository CacheRepositorydecorator that offloads entry payloads to aPayloadStore.
Traits§
- Payload
Store - Pluggable payload storage behind
OffloadRepository.
Functions§
- default_
offload_ clock - The default production clock:
SystemTime::now.
Type Aliases§
- Offload
Clock - Injectable wall clock for death-epoch math and deterministic tests.