Safe Haskell | None |
---|---|
Language | Haskell2010 |
Provide a notion of fanout wherein a single input is passed to several consumers. The consumers are run concurrently.
- fanout :: (MonadBaseControl IO m, Semigroup r) => [ProcessT m a r] -> ProcessT m a r
- fanoutSteps :: (MonadBaseControl IO m, Monoid r) => [ProcessT m a r] -> ProcessT m a r
Documentation
fanout :: (MonadBaseControl IO m, Semigroup r) => [ProcessT m a r] -> ProcessT m a r Source #
Share inputs with each of a list of processes in lockstep. Any values yielded by the processes for a given input are combined into a single yield from the composite process.
fanoutSteps :: (MonadBaseControl IO m, Monoid r) => [ProcessT m a r] -> ProcessT m a r Source #
Share inputs with each of a list of processes in lockstep. If
none of the processes yields a value, the composite process will
itself yield mempty
. The idea is to provide a handle on steps
only executed for their side effects. For instance, if you want to
run a collection of ProcessT
s that await but don't yield some
number of times, you can use 'fanOutSteps . map (fmap (const ()))'
followed by a taking
process.