vgrep-0.2.3.0: A pager for grep
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Concurrent.STM.TPQueue

Description

A transactional priority queue, based on a Finger Tree.

Synopsis

Documentation

data TPQueue k v Source #

TPQueue is an unbounded priority queue based on a Finger Tree.

newTPQueue :: Ord k => STM (TPQueue k v) Source #

Build a new TPQueue.

newTPQueueIO :: Ord k => IO (TPQueue k v) Source #

IO version of newTPQueue. This is useful for creating top-level TPQueues using unsafePerformIO, because using atomically inside unsafePerformIO isn't possible.

writeTPQueue :: Ord k => TPQueue k v -> k -> v -> STM () Source #

Write a value to a TPQueue.

readTPQueue :: Ord k => TPQueue k v -> STM v Source #

Read the next minimal value from a TPQueue.

tryReadTPQueue :: Ord k => TPQueue k v -> STM (Maybe v) Source #

A version of readTPQueue that does not retry, but returns Nothing instead if no value is available.

peekTPQueue :: Ord k => TPQueue k v -> STM v Source #

Get the next minimal value from a TPQueue without removing it.

tryPeekTPQueue :: Ord k => TPQueue k v -> STM (Maybe v) Source #

A version of peekTPQueue that does not retry, but returns Nothing instead if no value is available.

isEmptyTPQueue :: Ord k => TPQueue k v -> STM Bool Source #

Returns True if the TPQueue is empty.