InMemoryLockStore class

In-memory lock store used for tests and local scheduling.

Implements a simple TTL-based mutex map. Each key is associated with an owner and an expiration timestamp.

Implemented types

Constructors

InMemoryLockStore()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

acquire(String key, {Duration ttl = const Duration(seconds: 30), String? owner}) Future<Lock?>
Attempts to acquire a lock for key, with ttl and optional owner.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ownerOf(String key) Future<String?>
Returns the owner of the lock if it exists and has not expired.
override
release(String key, String owner) Future<bool>
Releases the lock if the requesting owner matches.
override
releaseLock(String key) → void
Internal helper to release a lock by key, bypassing owner checks.
renew(String key, String owner, Duration ttl) Future<bool>
Extends the lock TTL when the owner still holds it.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited