StaleLockPolicy class abstract interface

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.
const
factory
StaleLockPolicy.never()
Never reclaims; the caller guarantees the holder finishes or fails fast.
const
factory
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 heartbeatInterval so the backstop measures idle time, not work time.
const
factory

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 stat and file content is 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