invalidate method
Invalidates cached and in-flight values for subsequent callers.
Existing callers still receive the running result, but that stale result cannot be written back into the cache.
Implementation
void invalidate(String key) {
_cache.remove(key);
final inFlight = _inFlight.remove(key);
if (inFlight != null) {
inFlight.invalidated = true;
}
}