AdjacentLockStrategy class final
Default multi-process LockStrategy storing <targetPath>.lock directly
next to the container file.
The lock location depends only on the (symlink-resolved) container path,
so all peers coordinate correctly regardless of environment variables,
users, or temp directories. The lock file's inode never changes when
compact() atomically rename()s the container.
- Implemented types
Constructors
- AdjacentLockStrategy(String targetPath, {bool readOnly = false, Duration? timeout})
-
Creates an AdjacentLockStrategy for the container at
targetPath.
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
-
close(
) → Future< void> -
Releases any lock descriptors or handles maintained by this strategy.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readGenerationSync(
) → int -
Reads the stored compaction generation (
0if uninitialized), callable while holding withSharedLock or withExclusiveLock.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
withExclusiveLock<
T> (Future< T> action()) → Future<T> -
Acquires an exclusive (writer/compactor) lock, runs
action, and releases the lock.inherited -
Acquires a shared (reader) lock, runs
action, and releases the lock.inherited -
writeGenerationSync(
int generation) → void -
Stores
generationinside the lock descriptor, callable while holding withExclusiveLock.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited