readwritelock
readwritelock ¶
Module for Read/Write lock for fsspec filesystems
Classes¶
FileLock ¶
ReadLock ¶
ReadLock(
path_config,
retry_time=10,
retry_await_time=0,
timeout=172800,
write_lock_name="write.lock",
read_lock_name="read.lock",
is_acquired=False,
)
Bases: FileLock
Read lock for fsspec filesystems.
Initialize ReadLock
Source code in niceml/utilities/readwritelock.py
Functions¶
__eq__ ¶
Compares two file locks
Source code in niceml/utilities/readwritelock.py
acquire ¶
Acquire the lock
Source code in niceml/utilities/readwritelock.py
force_delete ¶
Force delete the lock
Source code in niceml/utilities/readwritelock.py
is_acquirable ¶
Checks if lock file does not exist
Source code in niceml/utilities/readwritelock.py
release ¶
Release the lock
Source code in niceml/utilities/readwritelock.py
WriteLock ¶
WriteLock(
path_config,
retry_time=10,
retry_await_time=0,
timeout=172800,
write_lock_name="write.lock",
read_lock_name="read.lock",
is_acquired=False,
)
Bases: FileLock
Write lock for fsspec filesystems.
Initialize WriteLock
Source code in niceml/utilities/readwritelock.py
Functions¶
__eq__ ¶
Compares two file locks
Source code in niceml/utilities/readwritelock.py
acquire ¶
Acquire the lock
Source code in niceml/utilities/readwritelock.py
force_delete ¶
Force delete the lock
Source code in niceml/utilities/readwritelock.py
is_acquirable ¶
Checks if lock file does not exist
Source code in niceml/utilities/readwritelock.py
release ¶
Release the lock
Source code in niceml/utilities/readwritelock.py
Functions¶
acquire_lock_file ¶
Acquire the lock file.
Source code in niceml/utilities/readwritelock.py
decrease_lock_file_usage ¶
Decrease the lock file usage.
Source code in niceml/utilities/readwritelock.py
increase_lock_file_usage ¶
Increase the lock file usage.
Source code in niceml/utilities/readwritelock.py
is_lock_file_acquirable ¶
Check if the lock file is available. The lock file is available if it does not exist at lock_file_path.
Source code in niceml/utilities/readwritelock.py
release_lock_file ¶
Release the lock file.