Skip to main content

Module redb

Module redb 

Source
Expand description

Redb-backed persistent cache repository.

Mirrors idempotent/redb_repository.rs: all redb I/O is offloaded to tokio::task::spawn_blocking because redb::Database is blocking. Values are serde_json-serialized CacheEntry blobs.

§Sweep

A background task wakes every sweep_interval and reclaims entries whose expires_at + stale_retention < now. It is bound to the context’s CancellationToken: when the context shuts down, the sweep exits. The token is context-owned — dropping this repository aborts only the sweep task handle, never the token (cancelling it would tear down the whole context).

Structs§

RedbCacheRepository
Redb-backed implementation of CacheRepository.