hw-polysemy-0.2.4.0: Opinionated polysemy library
Safe HaskellSafe-Inferred
LanguageGHC2021

HaskellWorks.Polysemy.Control.Concurrent.QSem

Synopsis

Documentation

data QSem #

QSem is a quantity semaphore in which the resource is acquired and released in units of one. It provides guaranteed FIFO ordering for satisfying blocked waitQSem calls.

The pattern

  bracket_ waitQSem signalQSem (...)

is safe; it never loses a unit of the resource.

waitQSem :: Member (Embed IO) r => QSem -> Sem r () Source #

signalQSem :: Member (Embed IO) r => QSem -> Sem r () Source #

bracketQSem :: Member (Embed IO) r => Member Resource r => QSem -> Sem r a -> Sem r a Source #