polysemy-conc-0.14.1.1: Polysemy effects for concurrency
Safe HaskellNone
LanguageGHC2021

Polysemy.Conc.Semaphore

Description

A quantity semaphore effect.

Synopsis

Documentation

data Semaphore (a :: Type -> Type) b 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 :: EffectRow). Member Semaphore r => Sem r () Source #

Release a slot.

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

Wait until a slot is available, then acquire it.