stm-promise- Simple STM Promises for IO computations and external processes

Safe HaskellSafe-Inferred



TVars with a dirty bit that allows for one listener



data DTVar a Source

TVars with a dirty bit which allows for one listener.

newDTVar :: a -> STM (DTVar a) Source

New DTVar which starts dirty

writeDTVar :: DTVar a -> a -> STM () Source

Write a value to a DTVar, making it dirty

readDTVar :: DTVar a -> STM a Source

Reads a DTVar without changing the dirty bit

listenDTVar :: DTVar a -> STM a Source

Listens until the dirty bit is true, then removes the dirty bit and returns the read element

listenDTVars :: [DTVar a] -> STM [a] Source

Listen until any of the dirty bits are true, then removes all dirty bits and returns all DTVar's values, in order.

modifyDTVar :: DTVar a -> (a -> a) -> STM () Source

Modify a DTVar, making it dirty.