cloudflare / cloudflare/pingora
Add RTCache::remove
- Dominant language
- Rust
- Stars
- 27.4k
- Forks
- 1.7k
- Avg merge
- 6h 22m
- Merged PRs (30d)
- 3
Description
## What is the problem your feature solves, or the need it fulfills?
The `RTCache` currently does not provide a way to remove keys.
My concrete need is pruning stale values and forcing a fresh lookup based on external events.
## Describe the solution you'd like
Add `RTCache::remove()`.
One design consideration is if a removal should interact with currently running lookups.
If a lookup is in progress, `remove()` may have unintuitive behaviour, because the key will be re-populated, but might still end up as stale because the lookup was started earlier.
The recommendation is to make the remove method async and wait for running lookups to finish by acquiring the lock.
Contributor guide
Assessment
This issue has not been assessed yet.