polysemy-conc-0.12.0.0: Polysemy effects for concurrency
Safe HaskellSafe-Inferred
LanguageHaskell2010

Polysemy.Conc.Semaphore

Description

A quantity semaphore effect.

Synopsis

Documentation

data Semaphore :: Effect Source #

This effect abstracts over the concept of a quantity semaphore, a concurrency primitive that contains a number of slots that can be acquired and released.

signal :: forall r. Member Semaphore r => Sem r () Source #

Release a slot.

wait :: forall r. Member Semaphore r => Sem r () Source #

Wait until a slot is available, then acquire it.