polysemy-conc-0.11.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.

Instances

Instances details
type DefiningModule Semaphore Source # 
Instance details

Defined in Polysemy.Conc.Effect.Semaphore

type DefiningModule Semaphore = "Polysemy.Conc.Effect.Semaphore"

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.