I have a situation where I need multiple workers (let's say 2). Workers must perform a task consuming upstream events.
The task at hand consumes a list of events and has a constant time independent from the size of the list.
Therefore I wish upstream to deliver a list with all the buffered events only when requested to, 1 list at a time.
Sadly most methods implement prefetching.
What happens is that even using
limitRate(1, 0) upstream receives one too many onRequest(1), just to replenish the downstream buffer.
So I struggle to have the buffered list produced just when a worker is available: they are usually produced in advance missing my goal of maximizing the size of the buffered list.
How can I implement such a setup?
Is there a way to disable prefetching altogether?