Skip to main content

Lockfile object with timeouts and context manager

Project description

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

Usage

Example usage:

import yg.lockfile
try:
    with yg.lockfile.LockFile('/tmp/lockfile', timeout=900):
            protected_operation()
except yg.lockfile.LockFileTimeout:
    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-1.1.2.zip (7.8 kB view hashes)

Uploaded Source

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