jaemk / cached

Rust cache structures and easy function memoization
MIT License
1.57k stars 95 forks source link

stale-while-revalidate feature #228

Open mharkins-cosm opened 1 month ago

mharkins-cosm commented 1 month ago

Would you support a stale-while-revalidate feature in this crate? If so, I'd be happy to start work on it.

EDIT: To clarify, I'd expect the mechanism to synchronize write access to the cache key as with the sync_writes feature, but rather than blocking, it would authorize failed attempts to return a stale value while the lock holder rebuilds the cache value.