Fast hierarchical locks
Project description
Hierarchical locks
Allows the caller to lock a "directory", or an individual file.
Locks are, by default, shared, recursive & timed.
First optional argument to the lock manager is the "sep".
Second optional argument is "recursive" (default true).
from hilok import HiLok
h = HiLok() # default sep is '/', can pass it in here
rd = h.read("/some/path")
# nonblocking, this will fail!
try:
wr = h.write("/some", block=False)
except TimeoutError:
pass
rd.release()
wr = h.write("/some")
# timeout=0 is the the same as block=False
rd = h.read("/some/path", block=False)
# with syntax is fine:
with h.read("/some/path"):
pass
Lock escalation (read/write/release-read) and de-escalation (write/read/release-write) are supported.
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 Distributions
Built Distributions
File details
Details for the file hilok-1.2.0-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: hilok-1.2.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 95.6 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2adab2c868e69a9bbe189d6ea195e7b196c58932d7994386e2fe1678595fb41 |
|
MD5 | bf4c4131131b4a4649c545403e3c18d6 |
|
BLAKE2b-256 | c3274208e60d7c9b7abc86eec4e16f7abfcb868fe2586bb97265570f39216c92 |
File details
Details for the file hilok-1.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: hilok-1.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 102.1 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a36f0a24ae9cc19d246c51fc6a4782d20f1fe699446b7a883a35a7b3b290fe3 |
|
MD5 | 0908ef6c842d27dfcec82b645b4984ba |
|
BLAKE2b-256 | 4a339c691c0515a4410cf88dd046bfba99b8e85af45b6bc5dc85c2b6738e1dee |
File details
Details for the file hilok-1.2.0-cp310-cp310-macosx_12_0_x86_64.whl
.
File metadata
- Download URL: hilok-1.2.0-cp310-cp310-macosx_12_0_x86_64.whl
- Upload date:
- Size: 80.4 kB
- Tags: CPython 3.10, macOS 12.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3d199a67c10ef9fe5f9f2145b653f9418cdcebefd5961f99c7794f94dac870f |
|
MD5 | 904dee24222cf48f2155661e7d7df932 |
|
BLAKE2b-256 | 0a634ac91684e2e86c3c0cfedf13527d6a106517a03396069731b4345f09e9e2 |
File details
Details for the file hilok-1.2.0-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: hilok-1.2.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 95.7 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4b4db858df465bb37269a598405794448d4af97aa0d85b777821b6bf7452700 |
|
MD5 | 23178a672531ddce1d118de50b3cd4c8 |
|
BLAKE2b-256 | ac69bc6d08651fe489d9a18bf5f77dd271e75ed72534192c115fe3779f8d94a0 |
File details
Details for the file hilok-1.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: hilok-1.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 102.2 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6800f2f5654e938d08249cbeb34dedd9ef07062921f6bccb23e2a6598deb1609 |
|
MD5 | 053a6a3e8e66e8c9ff67562b982d6f71 |
|
BLAKE2b-256 | 39d5843523fd15cbb37a8ed93d71bd692b162991d3bda8c24669dd03f5d1c547 |
File details
Details for the file hilok-1.2.0-cp39-cp39-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: hilok-1.2.0-cp39-cp39-macosx_10_15_x86_64.whl
- Upload date:
- Size: 83.5 kB
- Tags: CPython 3.9, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c98a9806ec4a6432bcf52bed1e59e18ed09c87a11a9bcb73b3ed41704a1da6b7 |
|
MD5 | 5e32ebc7ddb8d3ea3ed4f04405865dcb |
|
BLAKE2b-256 | d8f64f2ae260db00748552027314a42d2fa257eee61af55e7ba3fc878804670c |