Provide locks with interface similar to those from threading and multiprocessing, which are applicable in other situations
Project description
# locking
![build status](https://jbylund.semaphoreci.com/badges/locking/branches/master.svg?style=semaphore)[view logs](https://jbylund.semaphoreci.com/branches/a07cc01d-abee-46d0-8557-64abee8fbfc2)
1. [Overview](#overview) 1. [Examples](#examples) 1. [Installation](#installation)
## <a id=’overview’>Overview</a>
These locks provide a similar interface to those in the threading and multiprocessing modules with a different set of tradeoffs. These locks are useable by multiple different processes when those processes agree on a naming scheme. This can be used in order to allow multiple processes running on the same machine to semi-coordinate or in the case of the redis or dynamo backed locks multiple processes running on different machines to coordinate work. This provides a different type of coordination than multiple workers consuming from a single queue and can allow quickly prototyping a solution where workers attempt to grab a job and take a lock on it, grabbing another job if they fail at getting the lock. One benefit of this type of solution is that it allows running on spot hardware in the cloud since if a single job is dropped before it is completed the lock will soon expire and another worker will be able to grab that same piece of work.
## <a id=’examples’>Examples</a>
### SocketLock
`python # todo `
### FileLock
`python # todo `
### RedisLock
`python # todo `
### DynamoLock
`python # todo `
## <a id=’installation’>Installation</a>
### From PyPI
`python # todo `
### From GitHub
` python -m pip install --upgrade git+https://git@github.com/jbylund/locking.git `
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
File details
Details for the file locking-1.1.3.tar.gz
.
File metadata
- Download URL: locking-1.1.3.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a1abb5cc766e859f4bdb5dcb19552fafa8d7662c2abf7dd417c87bcb6eb785d |
|
MD5 | 548a13bc5c7a178ab655264e47f68fa6 |
|
BLAKE2b-256 | 2863ca6456bf717800e38e68df04d28e0e7302b41f2c16977c1941fd09ab3ca9 |