Readers / writers file lock Python helper class
This library was created in order to ease the synchronization of several processes using shared resources, like a caching directory or a SQLite database. All of them can use the resources, but only one should update them.
The library is being used in several INB projects.
Example of a shared lock using context:
import datetime
import os
import time
from RWFileLock import RWFileLock
lock = RWFileLock("/tmp/rwfilelock.lock")
with lock.shared_lock():
print(
f"[{datetime.datetime.now().isoformat()}] Got shlock {os.getpid()}"
)
time.sleep(7)
print(
f"[{datetime.datetime.now().isoformat()}] Releasing shlock {os.getpid()}"
)
Release files for RWFileLock 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| RWFileLock-0.2.2.tar.gz | 13.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| RWFileLock-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.5 kB
Release files / RWFileLock-0.2.2.tar.gz
| Download URL | RWFileLock-0.2.2.tar.gz |
|---|---|
| Size | 13.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41ec012d8edd1827d39553ce5cd9e59b04870f885ab1710da2b275e349a0ab66
|
|
BLAKE2b-256 checksum How to use checksums |
c4258324fc6725daafa04c06222217c5b7e8f5c97c77471a8d791f105716e1b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.17
|
Release files / RWFileLock-0.2.2-py3-none-any.whl
| Download URL | RWFileLock-0.2.2-py3-none-any.whl |
|---|---|
| Size | 14.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
24d60c9192021c6fad19b5163849188bbc20df9e01a519f130431f60a5751c36
|
|
BLAKE2b-256 checksum How to use checksums |
5f2bd1caae8b2de44b6cec5416e01cc3c6a09fa24263b02f7b0372e2dbed681c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.17
|