Skip to main content

Lockfile object with timeouts and context manager

Project description

A FileLock 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.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.1.1.tar.gz (4.9 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for yg.lockfile-2.1.1.tar.gz
Algorithm Hash digest
SHA256 3156ee5f4fa2511a6e1d544f4dbed39961f4ac40637dc157c0549fca6942ba72
MD5 78040130b6764ccdd1d806d5315a383d
BLAKE2b-256 28ae00ac89c07ace97502d530a3cf0cbeac9f171bf166e7f3043f1c932be2483

See more details on using hashes here.

Provenance

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