BoundedSemaphore
A semaphore shared by every thread and process on the cache: at most value holders at once.
Usage
BoundedSemaphore(
cache,
key,
value=1,
expire=None,
tag=None,
)Releasing more than were acquired raises AssertionError.
Methods
| Name | Description |
|---|---|
| acquire() | Wait for a free slot and take it. |
| release() | Give a slot back. |
acquire()
Wait for a free slot and take it.
Usage
acquire()release()
Give a slot back.
Usage
release()