brick-0.24: A declarative terminal user interface library

Safe HaskellSafe
LanguageHaskell2010

Brick.BChan

Synopsis

Documentation

data BChan a Source #

BChan is an abstract type representing a bounded FIFO channel.

newBChan Source #

Arguments

:: Int

maximum number of elements the channel can hold

-> IO (BChan a) 

Builds and returns a new instance of BChan.

writeBChan :: BChan a -> a -> IO () Source #

Writes a value to a BChan; blocks if the channel is full.

readBChan :: BChan a -> IO a Source #

Reads the next value from the BChan; blocks if necessary.

readBChan2 :: BChan a -> BChan b -> IO (Either a b) Source #

Reads the next value from either BChan, prioritizing the first BChan; blocks if necessary.