-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | An implementation of a real-time concurrent queue -- -- An implementation of a real-time concurrent queue. @package stm-queue @version 0.1.0.0 module Data.Queue -- | Create a new, empty queue newQueue :: STM (Queue a) -- | Peek at the top of the queue, returning the top element. peek :: Queue a -> STM a -- | Try to peek for the top item of the queue. This function is -- offered to easily port from the TQueue offered in the stm -- package, but is not the intended usage of the library. tryPeek :: Queue a -> STM (Maybe a) -- | Enqueue a single item onto the queue. enqueue :: Queue a -> a -> STM () -- | Dequeue a single item onto the queue, retrying if there is -- nothing there. This is the motivating use case of this library, -- allowing a thread to register its interest in the head of a queue and -- be woken up by the runtime system to read from the top of that queue -- when an item has been made available. dequeue :: Queue a -> STM a -- | Try to dequeue a single item. This function is offered to allow -- users to easily port from the TQueue offered in the stm -- package, but is not the intended usage of the library. tryDequeue :: Queue a -> STM (Maybe a)