Skip to main content

Lockfile object with timeouts and context manager

Project description

https://img.shields.io/pypi/v/yg.lockfile.svg https://img.shields.io/pypi/pyversions/yg.lockfile.svg https://img.shields.io/pypi/dm/yg.lockfile.svg https://img.shields.io/travis/yougov/yg.lockfile/master.svg

A FileLock class that implements a context manager with timeouts on top of zc.lockfile, an excellent, cross-platorm implementation of file locking.

License

License is indicated in the project metadata (typically one or more of the Trove classifiers). For more details, see this explanation.

Usage

Example usage:

import yg.lockfile
try:
    with yg.lockfile.FileLock('/tmp/lockfile', timeout=900):
            protected_operation()
except yg.lockfile.FileLockTimeout:
    handle_unable_to_lock()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for yg.lockfile, version 2.3
Filename, size File type Python version Upload date Hashes
Filename, size yg.lockfile-2.3-py2.py3-none-any.whl (6.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size yg.lockfile-2.3.tar.gz (6.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page