TBQueue is an abstract type representing a bounded FIFO channel.
Moduleconcurrency-1.11.0.3Haskell2010
Control.Concurrent.Classy.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 blocks until an
element is removed from the queue.
The implementation is based on the traditional purely-functional queue representation that uses two lists to obtain amortised O(1) enqueue and dequeue operations.
Deviations: TBQueue as defined here does not have an Eq
instance, this is because the MonadSTM TVar type does not have
an Eq constraint. Furthermore, the newTBQueueIO function is not
provided.
- 1 type
- 11 values
- Packageconcurrency-1.11.0.3
- Exports12
- LanguageHaskell2010
- LicenceMIT
- SourceTBQueue.hs
TBQueue
12 declarationsnewTBQueue Builds and returns a new instance of TBQueue
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; retries if the queue is full.
Put a data item back onto a channel, where it will be the next item read. Retries if the queue is full.
Return the length of a TBQueue.