prefect.locking.filesystem
Classes
FileSystemLockManager
A lock manager that implements locking using local files.
Methods:
aacquire_lock
aacquire_lock
key
: Unique identifier for the transaction record.holder
: Unique identifier for the holder of the lock.acquire_timeout
: Max number of seconds to wait for the record to become available if it is locked while attempting to acquire a lock. Pass 0 to attempt to acquire a lock without waiting. Blocks indefinitely by default.hold_timeout
: Max number of seconds to hold the lock for. Holds the lock indefinitely by default.
- True if the lock was successfully acquired; False otherwise.
acquire_lock
acquire_lock
key
: Unique identifier for the transaction record.holder
: Unique identifier for the holder of the lock.acquire_timeout
: Max number of seconds to wait for the record to become available if it is locked while attempting to acquire a lock. Pass 0 to attempt to acquire a lock without waiting. Blocks indefinitely by default.hold_timeout
: Max number of seconds to hold the lock for. Holds the lock indefinitely by default.
- True if the lock was successfully acquired; False otherwise.
await_for_lock
await_for_lock
key
: Unique identifier for the transaction record.timeout
: Maximum time to wait. None means to wait indefinitely.
- True if the lock becomes free within the timeout; False otherwise.
is_lock_holder
is_lock_holder
key
: Unique identifier for the transaction record.holder
: Unique identifier for the holder of the lock.
- True if the current holder is the lock holder; False otherwise.
is_locked
is_locked
key
: Unique identifier for the transaction record.
- True is the record is locked; False otherwise.
release_lock
release_lock
key
: Unique identifier for the transaction record.holder
: Unique identifier for the holder of the lock. Must match the holder provided when acquiring the lock.
wait_for_lock
wait_for_lock
key
: Unique identifier for the transaction record.timeout
: Maximum time to wait. None means to wait indefinitely.
- True if the lock becomes free within the timeout; False otherwise.