Readers / writers file lock helper class
Project description
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()}"
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 RWFileLock-0.2.2.tar.gz.
File metadata
- Download URL: RWFileLock-0.2.2.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41ec012d8edd1827d39553ce5cd9e59b04870f885ab1710da2b275e349a0ab66
|
|
| MD5 |
60e8662d44fae8826369e773fd31230d
|
|
| BLAKE2b-256 |
c4258324fc6725daafa04c06222217c5b7e8f5c97c77471a8d791f105716e1b2
|
File details
Details for the file RWFileLock-0.2.2-py3-none-any.whl.
File metadata
- Download URL: RWFileLock-0.2.2-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24d60c9192021c6fad19b5163849188bbc20df9e01a519f130431f60a5751c36
|
|
| MD5 |
0552a115d9837324a17e94f47987513a
|
|
| BLAKE2b-256 |
5f2bd1caae8b2de44b6cec5416e01cc3c6a09fa24263b02f7b0372e2dbed681c
|