pyufunc.with_file_lock#
- pyufunc.with_file_lock(lock_path, timeout=-1)#
Return a file lock context manager.
- Parameters:
lock_path – Path to the lock file.
timeout – Maximum seconds to wait for the lock. Use
-1to wait forever.
Note
Source package:
filelock.Source repository: tox-dev/py-filelock
Source document: https://py-filelock.readthedocs.io
Source license: MIT License.
Example
>>> with with_file_lock("data.lock"): ... pass
- Returns:
A
filelock.FileLockcontext manager.- Return type:
Any