hyperlane-plugin-cache 22.13.0

A 64-way sharded bounded in-memory and HTTP response cache plugin for the Hyperlane framework with TTL, byte-budget eviction, single-flight stampede coalescing, pluggable CacheStore traits, and RFC Cache-Control/Vary/Age/X-Cache handling.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::*;

/// Boxed `Send` future returned by async [`CacheStore`] trait methods.
pub type CacheFuture<'a, T> = Pin<Box<dyn Future<Output = T> + Send + 'a>>;

/// Thread-safe shared reference to a pluggable [`CacheStore`].
pub type SharedCacheStore = Arc<dyn CacheStore>;

/// Fixed-size 64-way sharded cache entry map array.
pub(crate) type CacheShardArray =
    Box<[RwLock<HashMapXxHash3_64<String, Arc<CacheEntry>>>; CACHE_SHARD_COUNT]>;

/// Fixed-size 64-way sharded single-flight inflight table.
pub(crate) type InFlightShardArray =
    Box<[Mutex<HashMapXxHash3_64<String, Arc<InFlightSlot>>>; CACHE_SHARD_COUNT]>;