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

Polysemy.Conc.SyncRead

Description

 
Synopsis

Documentation

whileEmpty :: forall a (r :: EffectRow). Member (SyncRead a) r => Sem r () -> Sem r () Source #

Run an action repeatedly until the SyncRead variable is available.

whileEmptyInterval :: forall a u t d (r :: EffectRow). (TimeUnit u, Members '[Time t d, SyncRead a] r) => u -> Sem r () -> Sem r () Source #

Run an action repeatedly until the SyncRead variable is available, waiting for the specified time between executions.

empty :: forall d (r :: EffectRow). Member (SyncRead d) r => Sem r Bool Source #

Indicate whether the variable is empty.

wait :: forall d (r :: EffectRow) u. (Member (SyncRead d) r, TimeUnit u) => u -> Sem r (Maybe d) Source #

Read the variable, waiting until a value is available or the timeout has expired.

try :: forall d (r :: EffectRow). Member (SyncRead d) r => Sem r (Maybe d) Source #

Read the variable, returning Nothing immmediately if no value was available.

data SyncRead d (a :: Type -> Type) b Source #

An interface to a shared variable (MVar) that can only be read.

block :: forall d (r :: EffectRow). Member (SyncRead d) r => Sem r d Source #

Read the variable, waiting until a value is available.