Safe Haskell | None |
---|---|
Language | GHC2021 |
Polysemy.Conc.Effect.SyncRead
Synopsis
- data SyncRead d (a :: Type -> Type) b where
- block :: forall d (r :: EffectRow). Member (SyncRead d) r => Sem r d
- wait :: forall d (r :: EffectRow) u. (Member (SyncRead d) r, TimeUnit u) => u -> Sem r (Maybe d)
- try :: forall d (r :: EffectRow). Member (SyncRead d) r => Sem r (Maybe d)
- empty :: forall d (r :: EffectRow). Member (SyncRead d) r => Sem r Bool
Documentation
data SyncRead d (a :: Type -> Type) b where Source #
An interface to a shared variable (MVar
) that can only be read.
Constructors
Block :: forall d (a :: Type -> Type). SyncRead d a d | Read the variable, waiting until a value is available. |
Wait :: forall u d (a :: Type -> Type). TimeUnit u => u -> SyncRead d a (Maybe d) | Read the variable, waiting until a value is available or the timeout has expired. |
Try :: forall d (a :: Type -> Type). SyncRead d a (Maybe d) | Read the variable, returning |
Empty :: forall d (a :: Type -> Type). SyncRead d a Bool | Indicate whether the variable is empty. |
block :: forall d (r :: EffectRow). Member (SyncRead d) r => Sem r d Source #
Read the variable, waiting until a value is available.
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.