(Your proposition is very interesting, I'm trying to understand the implications)
e
elizarov
03/15/2018, 3:27 PM
When you
consumeEach { ... }
and you don’t need any more items you just do
throw CancellationException
(or some shared instance there of). That way you cancel the upstream producer.
elizarov
03/15/2018, 3:31 PM
We can even create a separate exception type to pull the resulting value for short-circuiting terminal opertation all the way up the stack. It is all just crazy idea that needs to be worked out.
j
Jonathan
03/15/2018, 4:57 PM
Ok, thanks for the answer. I figured out how to achieve it by throwing an exception. However, it makes operator writing a bit harder than it currently is. I know it's just a recent crazy idea, but thank you very much for thinking and working on this. This will be very useful.