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.

Source Distribution

yg.lockfile-2.3.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

yg.lockfile-2.3-py2.py3-none-any.whl (6.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file yg.lockfile-2.3.tar.gz.

File metadata

  • Download URL: yg.lockfile-2.3.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for yg.lockfile-2.3.tar.gz
Algorithm Hash digest
SHA256 b8c8a482958daaa47682bc3004d237c2888e0086e55c2b47b5d8810d100db732
MD5 3c2426accf171207cb6a4a35e2fa3c7b
BLAKE2b-256 60f33d5a9426ca76d18fa12a9d5be26e6bffcb43be6fccd7466076ea888e271f

See more details on using hashes here.

File details

Details for the file yg.lockfile-2.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for yg.lockfile-2.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b3fe554a90a7ee97393bc0d2f27068894c401c91b7d92b76c04348fd13b86570
MD5 fcb5d6cf737bd8b7fd71c0e3f872473e
BLAKE2b-256 398619446e44425d4986e156af8990b399afe19df87bcb83b1e3023623143839

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page