A Python library for distributed locking via a variety of backends.
Project description
Padlock
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_padlock-0.1.2-py3-none-any.whl.
File metadata
- Download URL: python_padlock-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c67d9689a790d63a9c52ac49e680f5beebe2e22b16774a66ee55087e370ead5b
|
|
| MD5 |
b2f82147439891e9b658616e427c2229
|
|
| BLAKE2b-256 |
47da509b646d288e06d33e690def2b520e272d45db4a894b3e031602f14c8397
|