Module

Effect.Aff.Bus

#make

make :: forall m a. MonadEffect m => m (BusRW a)

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

#read

read :: forall a r. BusR' r a -> Aff a

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

#write

write :: forall a r. a -> BusW' r a -> Aff Unit

Pushes a new value to the Bus, yieldig immediately.

#split

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

Splits a bidirectional Bus into separate read and write Buses.

#kill

kill :: forall a r. Error -> BusW' r a -> Aff Unit

Kills the Bus and propagates the exception to all pending and future consumers.

#isKilled

isKilled :: forall m a r. MonadEffect m => BusR' r a -> m Boolean

Synchronously checks whether a Bus has been killed.

#Cap

data Cap

#Bus

data Bus (r :: Row Type) a

#BusRW

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

#BusR

type BusR = BusR' ()

#BusR'

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

#BusW

type BusW = BusW' ()

#BusW'

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

Modules