ownerOf method

  1. @override
Future<String?> ownerOf(
  1. String key
)
override

Returns the owner of the lock if it exists and has not expired.

Implementation

@override
/// Returns the owner of the lock if it exists and has not expired.
Future<String?> ownerOf(String key) async {
  final lock = _locks[key];
  if (lock == null) return null;
  if (lock.isExpired(stemNow())) {
    _locks.remove(key);
    return null;
  }
  return lock.owner;
}