Metadata-Version: 2.1
Name: hilok
Version: 1.0.4
Summary: Fast hierarchical locks
Home-page: https://github.com/AtakamaLLC/hilok
Author: Erik aronesty
Author-email: erik@atakama.com
License: UNKNOWN
Platform: UNKNOWN
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: test
Requires-Dist: pytest (>=6.0) ; extra == 'test'

= 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

```


