Skip to content

Commit

Permalink
stack: new module for a Cache stack
Browse files Browse the repository at this point in the history
For a read-write cache, we often want to direct new writes to a single
cache directory (sharded or otherwise), but still attempt to service
reads from a list of fallback read-only locations.

The `stack::Cache` struct implement that pattern.

TESTED=new smoke tests.
  • Loading branch information
pkhuong committed Sep 7, 2021
1 parent e077661 commit eee4e8f
Show file tree
Hide file tree
Showing 2 changed files with 606 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ pub mod raw_cache;
mod readonly;
pub mod second_chance;
mod sharded;
mod stack;
mod trigger;

pub use plain::PlainCache;
pub use readonly::ReadOnlyCache;
pub use readonly::ReadOnlyCacheBuilder;
pub use sharded::ShardedCache;
pub use stack::Cache;
pub use stack::CacheBuilder;

/// Sharded cache keys consist of a filename and two hash values. The
/// two hashes should be computed by distinct functions of the key's
Expand Down
Loading

0 comments on commit eee4e8f

Please sign in to comment.