TQueue is an abstract type representing an unbounded FIFO channel.
Modulestm-2.5.3.1Haskell2010
Control.Concurrent.STM.TQueue
A TQueue is like a TChan, with two important differences:
it has faster throughput than both
TChanandChan(although the costs are amortised, so the cost of individual operations can vary a lot).it does not provide equivalents of the
dupTChanandcloneTChanoperations.
The implementation is based on the traditional purely-functional queue representation that uses two lists to obtain amortised O(1) enqueue and dequeue operations.
- 1 type
- 10 values
- Packagestm-2.5.3.1
- Exports11
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceTQueue.hs
TQueue
11 declarationsBuild and returns a new instance of TQueue
IO version of newTQueue. This is useful for creating top-level
TQueues using unsafePerformIO, because using
atomically inside unsafePerformIO isn't
possible.
Read the next value from the TQueue.
A version of readTQueue which does not retry. Instead it
returns Nothing if no value is available.
Efficiently read the entire contents of a TQueue into a list. This function never retries.
Get the next value from the TQueue without removing it,
retrying if the channel is empty.
A version of peekTQueue which does not retry. Instead it
returns Nothing if no value is available.
Write a value to a TQueue.
Put a data item back onto a channel, where it will be the next item read.