checkEntry method

bool checkEntry(
  1. Object? key, {
  2. DateTime? now,
  3. Duration? keyTimeout,
})

Check the key entry timeout. Returns true if the key expired.

  • If the parameter keyTimeout is not provided the class field this.keyTimeout is used.

Implementation

bool checkEntry(Object? key, {DateTime? now, Duration? keyTimeout}) {
  if (isEntryExpired(key, now: now, keyTimeout: keyTimeout)) {
    _entries.remove(key);
    _entriesPutTime.remove(key);
    return true;
  } else {
    return false;
  }
}