make :: forall m a. MonadEffect m => m (BusRW a)
Creates a new bidirectional Bus which can be read from and written to.
read :: forall a r. BusR' r a -> Aff a
Blocks until a new value is pushed to the Bus, returning the value.
write :: forall a r. a -> BusW' r a -> Aff Unit
Pushes a new value to the Bus, yieldig immediately.
split :: forall a. BusRW a -> Tuple (BusR a) (BusW a)
Splits a bidirectional Bus into separate read and write Buses.
kill :: forall a r. Error -> BusW' r a -> Aff Unit
Kills the Bus and propagates the exception to all pending and future consumers.
isKilled :: forall m a r. MonadEffect m => BusR' r a -> m Boolean
Synchronously checks whether a Bus has been killed.
data Bus (r :: Row Type) a
type BusRW = Bus (read :: Cap, write :: Cap)
type BusR = BusR' ()
type BusR' r = Bus (read :: Cap | r)
type BusW = BusW' ()
type BusW' r = Bus (write :: Cap | r)