I have a stream of data that I process in several different ways... so I would like to send a copy of each message I get to multiple targets so that these targets may execute in parallel... however, I need to set BoundedCapacity
on my blocks because the data is streamed in way faster than my targets can handle them and there is a ton of data. Without BoundedCapacity
I would quickly run out of memory.
However the problem is BroadcastBlock
will drop messages if a target cannot handle it (due to the BoundedCapacity
).
What I need is a BroadcastBlock
that will not drop messages, but will essentially refuse additional input until it can deliver messages to each target and then is ready for more.
Is there something like this, or has anybody written a custom block that behaves in this manner?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…