Module

Control.Monad.Aff.Bus

Package
purescript-aff-bus
Repository
slamdata/purescript-aff-bus

#make Source

make :: forall a eff m. MonadEff (avar :: AVAR | eff) m => m (BusRW a)

Creates a new bidirectional Bus which can be read from and written to.

#read Source

read :: forall r a eff. BusR' r a -> Aff (avar :: AVAR | eff) a

Blocks until a new value is pushed to the Bus, returning the value.

#write Source

write :: forall r a eff. a -> BusW' r a -> Aff (avar :: AVAR | eff) Unit

Pushes a new value to the Bus, yieldig immediately.

#split Source

split :: forall a. BusRW a -> Tuple (BusR a) (BusW a)

Splits a bidirectional Bus into separate read and write Buses.

#kill Source

kill :: forall r a eff. Error -> BusW' r a -> Aff (avar :: AVAR | eff) Unit

Kills the Bus and propagates the exception to all consumers.

#Cap Source

data Cap

#Bus Source

data Bus (r :: Row Type) a

#BusRW Source

type BusRW = Bus (read :: Cap, write :: Cap)

#BusR Source

type BusR = BusR' ()

#BusR' Source

type BusR' r = Bus (read :: Cap | r)

#BusW Source

type BusW = BusW' ()

#BusW' Source

type BusW' r = Bus (write :: Cap | r)