chp-1.1.0: An implementation of concurrency ideas from Communicating Sequential ProcessesSource codeContentsIndex

A module containing broadcast channels (one-to-many). Whereas a one-to-any channel features one writer sending a single value to one (of many) readers, a one-to-many channel features one writer sending the same value to many readers. So a one-to-any channel involves claiming the channel-end to ensure exclusivity, but a one-to-many channel involves enrolling on the channel-end (subscribing) before it can engage in communication.

A communication on a one-to-many channel only takes place when the writer and all readers currently enrolled agree to communicate. What happens when the writer wants to communicate and no readers are enrolled is undefined (the writer may block, or may communicate happily to no-one).

data BroadcastChanin a
data BroadcastChanout a
type OneToManyChannel = Chan BroadcastChanin BroadcastChanout
type AnyToManyChannel = Chan BroadcastChanin (Shared BroadcastChanout)
oneToManyChannel :: CHP (OneToManyChannel a)
anyToManyChannel :: CHP (AnyToManyChannel a)
data BroadcastChanin a Source
The reading end of a broadcast channel. You must enroll on it before you can read from it or poison it.
show/hide Instances
data BroadcastChanout a Source
The writing end of a broadcast channel.
show/hide Instances
type OneToManyChannel = Chan BroadcastChanin BroadcastChanoutSource
type AnyToManyChannel = Chan BroadcastChanin (Shared BroadcastChanout)Source
oneToManyChannel :: CHP (OneToManyChannel a)Source
anyToManyChannel :: CHP (AnyToManyChannel a)Source
Produced by Haddock version 2.3.0