Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
This module provides Pipe
and BroadcastChan
helpers.
Synopsis
- data BroadcastChan a
- newBroadcastChan :: STM (BroadcastChan a)
- newReaderChan :: BroadcastChan a -> STM (TChan a)
- broadcast :: BroadcastChan a -> a -> STM ()
- data Pipe a
- newPipe :: STM (Pipe a)
- readPipe :: Pipe a -> STM a
- tryWritePipe :: Pipe a -> a -> STM Bool
BroadcastChan
data BroadcastChan a #
A BroadcastChan
is a single-producer multi-consumer channel.
newBroadcastChan :: STM (BroadcastChan a) #
Creates the producer end.
newReaderChan :: BroadcastChan a -> STM (TChan a) #
Creates a new reader end.
broadcast :: BroadcastChan a -> a -> STM () #
Broadcast a message.
Pipe
tryWritePipe :: Pipe a -> a -> STM Bool #
tryWritePipe
returns False when the message could not be delivered because the pipe is full.