uni-util-2.3.0.1: Utilities for the uniform workbench

Safe HaskellNone

Util.Broadcaster

Description

A BroadcasterSimpleBroadcaster is a variable SourceSimpleSource paired with its update function

Synopsis

Documentation

data Broadcaster x d Source

Instances

class BroadcasterClass broadcaster value | broadcaster -> value whereSource

Methods

broadcast :: broadcaster -> value -> IO ()Source

applySimpleUpdate' :: SimpleBroadcaster x -> (x -> (x, y)) -> IO ySource

applyUpdate :: Broadcaster x d -> (x -> (x, [d])) -> IO ()Source

applyGeneralUpdate :: GeneralBroadcaster x d -> (x -> (x, [d], extra)) -> IO extraSource

switchOffSimpleSource :: SimpleSource a -> IO (SimpleSource a, IO (IO ()))Source

Replace a SimpleSource by another which comes with a switch-off function, which temporarily blocks further updates. The action returned by the switch-off function switches the source back on again.

mirrorSimpleSource :: SimpleSource a -> IO (SimpleSource a, IO ())Source

Replace a SimpleSource by another which mirrors it, but only copies from it once, hopefully saving CPU time. The IO action stops the mirroring.

mirrorSimpleSourceWithDelayer :: Delayer -> SimpleSource a -> IO (SimpleSource a, IO ())Source

Replace a SimpleSource by another which mirrors it, but only copies from it once, hopefully saving CPU time. In addition, block all update while the Delayer is delaying things.