TBQueue is an abstract type representing a bounded FIFO channel.
Modulestm-2.5.3.1Haskell2010
Control.Concurrent.STM.TBQueue
TBQueue is a bounded version of TQueue. The queue has a maximum
capacity set when it is created. If the queue already contains the
maximum number of elements, then writeTBQueue retries until an
element is removed from the queue.
The implementation is based on an array to obtain O(1) enqueue and dequeue operations.
- 1 type
- 13 values
- Packagestm-2.5.3.1
- Exports14
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceTBQueue.hs
TBQueue
14 declarationsBuilds and returns a new instance of TBQueue.
IO version of newTBQueue. This is useful for creating top-level
TBQueues using unsafePerformIO, because using
atomically inside unsafePerformIO isn't
possible.
Read the next value from the TBQueue.
A version of readTBQueue which does not retry. Instead it
returns Nothing if no value is available.
Efficiently read the entire contents of a TBQueue into a list. This function never retries.
Get the next value from the TBQueue without removing it,
retrying if the channel is empty.
A version of peekTBQueue which does not retry. Instead it
returns Nothing if no value is available.
Write a value to a TBQueue; blocks if the queue is full.
Put a data item back onto a channel, where it will be the next item read. Blocks if the queue is full.
Return the length of a TBQueue.
The maximum number of elements the queue can hold.