That is the cool thing about coroutines (and Flows). You can code your own special flow behaviors, operators, etc in a very imperative/sequential way. 🙂
n
nitrog42
04/20/2020, 2:40 PM
hehe yeah that is almost too easy honnestly
😄 1
l
louiscad
04/20/2020, 9:16 PM
Note that this cannot be used for a timer because it doesn't take into account the execution time delay adding up, nor emit taking some time to resume (because the lambda of collect would take some time).
j
Jörg Winter
04/21/2020, 7:24 AM
Hi, coming over from another Slack-Thread about internal "collect" vs.
launchIn {}
, just to be clear on flow consumption:
the canonical way to consume is:
a) toList()
b) launchIn(...)
.. else ?