Safe Haskell | None |
---|

A persistent, transactional collection with Queue interface as well as indexed access by key.

Uses default persistence. See Data.TCache.DefaultPersistence

- type RefQueue a = DBRef (Queue a)
- getQRef :: (Typeable a, Serialize a) => String -> RefQueue a
- pop :: (Typeable a, Serialize a) => RefQueue a -> IO a
- popSTM :: (Typeable a, Serialize a) => RefQueue a -> STM a
- pick :: (Typeable a, Serialize a) => RefQueue a -> IO a
- flush :: (Typeable a, Serialize a) => RefQueue a -> IO ()
- flushSTM :: (Typeable a, Serialize a) => RefQueue a -> STM ()
- pickAll :: (Typeable a, Serialize a) => RefQueue a -> IO [a]
- pickAllSTM :: (Typeable a, Serialize a) => RefQueue a -> STM [a]
- push :: (Typeable a, Serialize a) => RefQueue a -> a -> IO ()
- pushSTM :: (Typeable a, Serialize a) => RefQueue a -> a -> STM ()
- pickElem :: (Indexable a, Typeable a, Serialize a) => RefQueue a -> String -> IO (Maybe a)
- pickElemSTM :: (Indexable a, Typeable a, Serialize a) => RefQueue a -> String -> STM (Maybe a)
- readAll :: (Typeable a, Serialize a) => RefQueue a -> IO [a]
- readAllSTM :: (Typeable a, Serialize a) => RefQueue a -> STM [a]
- deleteElem :: (Indexable a, Typeable a, Serialize a) => RefQueue a -> a -> IO ()
- deleteElemSTM :: (Typeable a, Serialize a, Indexable a) => RefQueue a -> a -> STM ()
- unreadSTM :: (Typeable a, Serialize a) => RefQueue a -> a -> STM ()
- isEmpty :: (Typeable a, Serialize a) => RefQueue a -> IO Bool
- isEmptySTM :: (Typeable a, Serialize a) => RefQueue a -> STM Bool

# Documentation

getQRef :: (Typeable a, Serialize a) => String -> RefQueue aSource

Get the reference to new or existing queue trough its name

Read the first element in the queue and delete it (pop)

flush :: (Typeable a, Serialize a) => RefQueue a -> IO ()Source

Empty the queue (factually, it is deleted)

pickAll :: (Typeable a, Serialize a) => RefQueue a -> IO [a]Source

Return the list of all elements in the queue. The queue remains unchanged

pickElem :: (Indexable a, Typeable a, Serialize a) => RefQueue a -> String -> IO (Maybe a)Source

Return the first element in the queue that has the given key

pickElemSTM :: (Indexable a, Typeable a, Serialize a) => RefQueue a -> String -> STM (Maybe a)Source

Version in the STM monad

readAll :: (Typeable a, Serialize a) => RefQueue a -> IO [a]Source

Return the list of all elements in the queue and empty it

deleteElem :: (Indexable a, Typeable a, Serialize a) => RefQueue a -> a -> IO ()Source

Delete all the elements of the queue that has the key of the parameter passed