tbox-0.0.0: Transactional variables with IO hooksSource codeContentsIndex
Control.Concurrent.TBox.Operations
Portabilitynon-portable (requires STM)
Stabilityexperimental
MaintainerPeter Robinson <thaldyron@gmail.com>
Description
Operations on instances of TBox.
Synopsis
delete :: TBox t a => t a -> AdvSTM ()
write :: TBox t a => t a -> a -> AdvSTM ()
read :: TBox t a => t a -> AdvSTM (Maybe a)
isEmpty :: TBox t a => t a -> AdvSTM Bool
Documentation
delete :: TBox t a => t a -> AdvSTM ()Source
Deletes the content.
write :: TBox t a => t a -> a -> AdvSTM ()Source
Writes the new content.
read :: TBox t a => t a -> AdvSTM (Maybe a)Source

If the TBox is dirty, this retries the transaction and rereads the content using readIO in a separate thread. Otherwise it simply returns the result of readSTM.

Note: Depending on the implementation, careless use of setDirty and read in the same transaction might lead to nonterminating retry loops.

isEmpty :: TBox t a => t a -> AdvSTM BoolSource
Returns True iff the TBox is empty.
Produced by Haddock version 2.4.2