| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Concurrency.TBQueue
Synopsis
- data TBQueue a
- newTBQueue :: Natural -> STM (TBQueue a)
- newTBQueueIO :: MonadIO m => Natural -> m (TBQueue a)
- readTBQueue :: TBQueue a -> STM a
- tryReadTBQueue :: TBQueue a -> STM (Maybe a)
- flushTBQueue :: TBQueue a -> STM [a]
- peekTBQueue :: TBQueue a -> STM a
- tryPeekTBQueue :: TBQueue a -> STM (Maybe a)
- writeTBQueue :: TBQueue a -> a -> STM ()
- unGetTBQueue :: TBQueue a -> a -> STM ()
- isEmptyTBQueue :: TBQueue a -> STM Bool
- isFullTBQueue :: TBQueue a -> STM Bool
- lengthTBQueue :: TBQueue a -> STM Natural
Documentation
TBQueue is an abstract type representing a bounded FIFO channel.
Since: stm-2.4
Builds and returns a new instance of TBQueue.
newTBQueueIO :: MonadIO m => Natural -> m (TBQueue a) #
Lifted version of newTBQueueIO
Since: unliftio-0.2.1.0
readTBQueue :: TBQueue a -> STM a #
Read the next value from the TBQueue.
tryReadTBQueue :: TBQueue a -> STM (Maybe a) #
A version of readTBQueue which does not retry. Instead it
returns Nothing if no value is available.
flushTBQueue :: TBQueue a -> STM [a] #
Efficiently read the entire contents of a TBQueue into a list. This
function never retries.
Since: stm-2.4.5
peekTBQueue :: TBQueue a -> STM a #
Get the next value from the TBQueue without removing it,
retrying if the channel is empty.
tryPeekTBQueue :: TBQueue a -> STM (Maybe a) #
A version of peekTBQueue which does not retry. Instead it
returns Nothing if no value is available.
writeTBQueue :: TBQueue a -> a -> STM () #
Write a value to a TBQueue; blocks if the queue is full.
unGetTBQueue :: TBQueue a -> a -> STM () #
Put a data item back onto a channel, where it will be the next item read. Blocks if the queue is full.
isFullTBQueue :: TBQueue a -> STM Bool #