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 -1 to wait forever.

Note

Example

>>> with with_file_lock("data.lock"):
...     pass
Returns:

A filelock.FileLock context manager.

Return type:

Any