Flux.SinkSourcefold fn init is a sink that reduces all input elements with the stepping function fn starting with the accumulator value init.
A full sink taht will not consume any input and will not produce any results.
is_full sink is true if sink is full. Full sinks do not consume any elements but will be initialized to determine if they are full.
is_empty is a sink that produces true when it is stopped without consuming any elements.
Consumes all elements producing nothing. Useful for triggering actions in effectful streams.
bqueue ~size returns a sink which fills the returned bounded-queue. The queue can be consumed by something else cooperatively (or in parallel).
fill x uses x to fill the sink. This sink will not consume any input and will immediately produce x when used.
zip l r computes both l and r cooperatively with the same input being sent to both sinks. The results of both sinks are produced.
both l r computes both l and r in parallel with the same input being sent to both sinks. The results of both sinks are produced.
NOTE: Please note that this function does not comply with Miou's rules if you attempt to use it in the form of a let-binding and+.
unzip l r is a sink that receives pairs 'a * 'b, sending the first element into l and the second into r. Both sinks are computed cooperatively and their results returned as an output pair.
The sink becomes full when either l or r get full.
each ?parallel ~init ~merge fn applies fn to all input elements and merge producing results with init. If parallel is true (default is false), fn is executed in parallel to the domain in which the sink is executed. Otherwise, the actions are executed cooperatively. If one of these actions terminates abnormally, the execution of the returned sink raises an exception.
premap fn sink is a sink that premaps the input value.
file ~filename saves string elements into the given file filename.
out_channel ?close oc saves string elements into the given out channel oc. If oc is not stdout and ?close is true (by default), out_channel will close it at the end.