stm-split-0.0.2: TMVars, TVars and TChans with distinguished input and output side

Safe HaskellSafe
LanguageHaskell98

Control.Concurrent.STM.Split.MVar

Synopsis

Documentation

data T dir a #

Instances

C T # 

Methods

newIO :: IO (T In a, T Out a) #

new :: STM (T In a, T Out a) #

read :: T Out a -> STM a #

write :: T In a -> a -> STM () #

type In = T In #

type Out = T Out #

newEmptyIO :: IO (In a, Out a) #

newEmpty :: STM (In a, Out a) #

newIO :: a -> IO (In a, Out a) #

new :: a -> STM (In a, Out a) #

take :: Out a -> STM a #

tryTake :: Out a -> STM (Maybe a) #

put :: In a -> a -> STM () #

tryPut :: In a -> a -> STM Bool #

write :: In a -> a -> STM () #

Write value to TMVar and overwrite existing content. It never blocks. Please note, that this function is different from the generic write, which blocks on TMVars.