Hi all, are my following assumptions about mult (& friends) correct?
I need to be VERY careful with transducers on chans, that are tap'd into a mult:
• they might slow down (or wreck) the whole mult-chain because it is processed synchronously
• buffers won't safeguard, because xf is applied early in put! (before hitting the buffer)
Solutions:
• use 2 chans instead of one:
A: tap'd into mult, controls buffering
|
| pipe (or pipeline with xf)
|
B: holds the xf
|
taker
• do all the work (e.g. filtering) in the taking processes instead of a chan-transducers, when working with mult
Thanks!I'm pretty sure that's correct. Per the docs, mult distributes all the taps synchronously. Transducers must be processed before the buffer since transducers can increase or decrease the number of items that end up on a channel.
One nice thing about transducers is that you can use their simpler pieces manually. If you want to run an arbitrary transducer as part of your take process, you can manually init, step, and complete the transducer.