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.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for python_padlock-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a27a682aaddbb5623fb9f478cbce741b2822077181776796e82c2936bb8bca1c
MD5 eb5b04420a821652d3d1486fb3dac1bd
BLAKE2b-256 c3146d874de1163ecd4dac18f29e7e87626d7dc5b40d2fe76a2f947409d43f69

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