Paul Woitaschek

03/30/2020, 3:32 PM
I'm trying to create my own version of combine because of As the current combine implementation uses a lot of internal apis I can't just copy-past it. My code so far looks like this: Can you review this and tells me if this a correct implementation?


03/30/2020, 3:43 PM
It looks sane- you start emitting lists when you have at least one value from each flow, and the list always contains the latest value from each. You’re using a channelFlow, so that should be thread-safe. I suspect the joinAll() isn’t needed, the coroutineScope won’t finish until all the children jobs have finished.