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

Polysemy.Conc.Effect.Semaphore

Description

Semaphore effect, Internal.

Synopsis

Documentation

data Semaphore :: Effect where 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.

Constructors

Wait :: Semaphore m ()

Wait until a slot is available, then acquire it.

Signal :: Semaphore m ()

Release a slot.

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

Wait until a slot is available, then acquire it.

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

Release a slot.