liblawless-0.26.0: Prelude based on protolude for GHC 8 and beyond.

Copyright© 2017 All rights reserved.
LicenseGPL-3
MaintainerEvan Cofsky <evan@theunixman.com>
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

STM.Scatter

Description

 

Synopsis

Documentation

data Scatter a Source #

A Scatter is a single source that can broadcast messages to any number of subscribers.

scatter :: MonadBase IO m => m (Scatter a) Source #

Creates a new Scatter.

scatterMsg :: MonadBase IO m => Scatter a -> a -> m () Source #

Post a message to a Scatter to all the subscribed Gathers.

data Gather a Source #

A Gather receives copies of all messages posted to the Scatter it was derived from.

gather :: MonadBase IO m => Getter (Scatter a) (m (Gather a)) Source #

Create a new Gather from a given Scatter.

gatherMsg :: MonadBase IO m => Gather a -> m a Source #

Read a message posted to a Gather by a Scatter.