zio.Semaphore
See theSemaphore companion object
An asynchronous semaphore, which is a generalization of a mutex. Semaphores have a certain number of permits, which can be held and released concurrently by different parties. Attempts to acquire more permits than available result in the acquiring fiber being suspended until the specified number of permits become available.
If you need functionality that Semaphore
doesnt' provide, use a
TSemaphore and define it in a zio.stm.ZSTM transaction.
Attributes
- Companion:
- object
- Graph
- Supertypes