Maintainer | Bas van Dijk <v.dijk.bas@gmail.com> , Roel van Dijk <vandijk.roel@gmail.com> |
---|
A Broadcast variable is a mechanism for communication between threads. Multiple reader threads can wait until a broadcaster thread writes a signal. The readers retry until the signal is received. When the broadcaster sends the signal all readers are woken.
This module is designed to be imported qualified. We suggest importing it like:
import Control.Concurrent.STM.Broadcast ( Broadcast ) import qualified Control.Concurrent.STM.Broadcast as Broadcast ( ... )
Documentation
A broadcast variable. It can be thought of as a box, which may be empty of full.
newWritten :: α -> STM (Broadcast α)Source
Create a new Broadcast
variable containing an initial value.