Skip to main content

A Python library for distributed locking via a variety of backends.

Project description

Padlock

PyPI - Python Version

Padlock is a Python library that provides a simple, asynchronous, and consistent API for distributed locking.

Quick Start

Installation

pip install python-padlock

Basic Usage

import asyncio

from padlock import LockManager, MemoryLockBackend


async def main():
    async with LockManager(MemoryLockBackend()) as manager:
        async with manager.lock('my-lock'):
            print('Lock acquired')
            await asyncio.sleep(5)
        print('Lock released')

You can find more examples in the examples directory.

License

This project is licensed under MIT License.

Support & Feedback

If you encounter any issues or have feedback, please open an issue. We'd love to hear from you!

Made with ❤️ by Emergent Methods

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_padlock-0.1.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file python_padlock-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for python_padlock-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c67d9689a790d63a9c52ac49e680f5beebe2e22b16774a66ee55087e370ead5b
MD5 b2f82147439891e9b658616e427c2229
BLAKE2b-256 47da509b646d288e06d33e690def2b520e272d45db4a894b3e031602f14c8397

See more details on using hashes here.

Supported by

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