Decides whether a waiter may reclaim an existing InterProcessLock file whose holder appears to have abandoned it.
Constructors
- StaleLockPolicy.age(Duration staleAfter)
-
Reclaims once the lock file's modified time is older than
staleAfter.constfactory - StaleLockPolicy.never()
-
Never reclaims; the caller guarantees the holder finishes or fails fast.
constfactory
- StaleLockPolicy.processLiveness({required Duration staleAfter})
-
Reclaims a lock whose recorded process is dead, with an age backstop for a
holder that leaked the lock while its process stayed alive (e.g. a hung
sibling isolate sharing the PID). Pair with InterProcessLock.acquire's
heartbeatIntervalso the backstop measures idle time, not work time.constfactory
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
-
isStale(
FileStat stat, String content) → bool -
Whether the lock with the given
statand filecontentis abandoned. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited