If I have a flow being read by 2 collectors, the e...
# coroutines
s
If I have a flow being read by 2 collectors, the emitter goes as fast as the faster collector, and everything gets buffered until the slower collector reads it. How do I limit that buffer so I get backpressure from the slowest collector?
z
How is your flow created?
s
flow { while(true) { emit( calcNextValue() ) } }
Oh, I did not realize that emit() is called independently for each collector. Flow is not what I want.
My question is nonsensical I guess.
d
You can use
produceIn(...)
and consume it once as a channel.