Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
A DeleteQueue is a queue where entries can be deleted by an IO action. This is a fairly specialised implementation, designed for event handling.
Queue entries are either active or invalid. Once invalid, removeQueue will not return them, but they still take up (a little) memory.
addQueue, removeQueue, isEmptyQueue, cleanQueue all take a delete queue as argument. We assume that this argument is not used again.
Either removeQueue or isEmptyQueue or cleanQueue should be run occasionally, to remove invalid entries.
Documentation
data DeleteQueue v Source
emptyQueue :: DeleteQueue v Source
addQueue :: DeleteQueue v -> v -> IO (DeleteQueue v, IO ()) Source
removeQueue :: DeleteQueue v -> IO (Maybe (v, DeleteQueue v, DeleteQueue v)) Source
isEmptyQueue :: DeleteQueue v -> IO (Maybe (DeleteQueue v)) Source
cleanQueue :: DeleteQueue v -> IO (DeleteQueue v) Source