HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

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 declarations
datadata TBQueue a
#

TBQueue is an abstract type representing a bounded FIFO channel.

Instances1Eq
  • Eq (TBQueue a)Defined in stm-2.5.3.1 · Control.Concurrent.STM.TBQueue
valuepeekTBQueue :: TBQueue a -> STM a
#

Get the next value from the TBQueue without removing it, retrying if the channel is empty.

valueunGetTBQueue :: 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.