Skip to main content

File lock support for asyncio.

Project description

aioflock: file lock support for asyncio (based on fcntl.flock)
==================================

.. image:: https://coveralls.io/repos/kolko/aioflock/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/kolko/aioflock?branch=master

.. image:: https://travis-ci.org/kolko/aioflock.svg?branch=master
:target: https://travis-ci.org/kolko/aioflock



Example:

.. code-block:: python

from aioflock import LockFilename
lock = LockFilename('/tmp/test_lock')
yield from lock.acquire()
..inside lock..
lock.release()



With stategment:

.. code-block:: python

from aioflock import LockFilename
with (yield from LockFilename('/tmp/test_lock')):
..inside lock..



Can use timeout:

.. code-block:: python

from aioflock import LockFilename, LockFilenameTimeout

try:
with (yield from LockFilename('/tmp/test_lock')):
with (yield from LockFilename('/tmp/test_lock', timeout=1)):
...newer here...
except LockFilenameTimeout:
...here...

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

aioflock-0.0.1.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file aioflock-0.0.1.tar.gz.

File metadata

  • Download URL: aioflock-0.0.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for aioflock-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c453ee180cb3597b8955efc0d80c39109edb60ff7f2e4720e7f13063a4f8081d
MD5 12ebbafcbd5ebfee697db0934660d21b
BLAKE2b-256 b6962494f54a8e5d8eb4598de77ae77f668a0ab80b62e478d874efbb8f90ab05

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