A source of a stream
A Source
manages a queue of events that it distributes to its subscribers asynchronously.
Each subscriber runs on the same thread as the event-distributor. So, if you have multiple
subscribers they will be processed serially for each event. If you want the subscribers to
run in parallel then you must lift the IO
monad when calling Subscribe
and forkIO
the
stream. This gives fine-grained control over when to run events in parallel.
type | A | Value type flowing downstream |
method StreamT<M, A> Await <M> () Source #
Subscribe to the source and await the values
Each subscriber runs on the same thread as the event-distributor. So, if you have multiple
subscribers they will be processed serially for each event. If you want the subscribers to
run in parallel then you must lift the IO
monad when calling Subscribe
and forkIO
the
stream. This gives fine-grained control over when to run events in parallel.
type | M | Monad type lifted into the stream |
returns | StreamT monad transformer that will get the values coming downstream |
method IO<Unit> Post (A value) Source #
Post a value to flow downstream
param | value | Value |
returns | IO effect |