Recursive as in, the consumer of the flow can send...
# coroutines
Recursive as in, the consumer of the flow can send more messages to it
I don't think that fits the common definition of recursion, perhaps an "infinite flow" is a better term. also, do you mean "producer of the flow"? the consumer doesn't send any messages
if you do mean producer, as long as you can somehow get the data into the block of code inside of
flow { .. }
, it can send more. whether that's a channel, or a queue, or a socket doesn't really matter, it just has to come to get to that block so it can be `emit`ted
bi-directional data flow ­čÖé Channel is the only idiomatic way I can think of to do it. Flow is a fairly uni-directional data stream.
Yeah, I mean consumer. Like, the consumer reads data off the flow but can feed more into it, the same way a function might recursively invoke itself Thanks, I figured as much.
aren't going away then? Just the fluent/builder API is moving toward flows?
just the intermediate operators on channels are being removed in favor of the operators on flows.
Copy code { it * 2 }
Copy code
channel.asFlow().map { it * 2 }
aha. borrowing
from JDK8 I see
(sorry, snark is my first language)
Pretty much without the downsides to JDK8 streams plus complete coroutines support ­čÖé