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
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
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for hilok-0.0.17-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0125d35c9a686c42fdf8bcd8ad66943423b5b82f4542596d5f9a701e3f6e9d41 |
|
MD5 | a73031901c2d056fb50938be45be81ac |
|
BLAKE2b-256 | 32b1b46b9b7fdb23007f5199c1826536e91541e400b0117a0bbe91d6e05a001c |
Close
Hashes for hilok-0.0.17-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66dc320265548c8bdd5b502b808e3016420e87a761f6aeee4fe0da420471346e |
|
MD5 | 5c9c0aeacfc0be5eb9a2ac615536c1f6 |
|
BLAKE2b-256 | ade33cae21da6a358501c04dc7c816de53922c8313bf84f78284494dbfa17aaa |
Close
Hashes for hilok-0.0.17-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0125931ce0b8f2c4b686d6a64775b327d3df205989ef3ab056e986b81664d824 |
|
MD5 | 45583ed71abcc6ab730b48ab24ae4f4e |
|
BLAKE2b-256 | a348f4cdfa6e6a68ae3a19e4c76e2146219de59e8c97d57b84e6d160407b8627 |
Close
Hashes for hilok-0.0.17-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 617773fb46f75196a9889da24fb8244e98d6ee0912e028a8adb7e05553b7174f |
|
MD5 | 2e70c5fe0a6140ed002d5006040049f9 |
|
BLAKE2b-256 | e08cc63849e7653bbd66070164bd08c759ccf5e50f44f66ebde6011d71be52cf |