sqlite-cache-0.1.1 has been yanked.
sqlite-cache
SQLite-based on-disk cache for Rust.
Usage
let cache = new.unwrap;
let topic = cache.topic.unwrap;
assert!;
topic.set
assert!;
Locked updates
This library supports locked updates to prevent the thundering herd problem on cache misses. The get_for_update
API acquires a per-key lock and returns a KeyUpdater
; subsequent get_for_update
calls on the same key will block until the previous KeyUpdater
is dropped.
let = topic.get_for_update.await.unwrap;
let new_value = expensive_computation.await;
updater.write.unwrap;