or do I need to do `flow { val result = client.dow...
# coroutines
d
or do I need to do
flow { val result = client.download(url); emit(result) }
instead of using
flowOf
?
Seems so... it wasn't so obvious though...
d
yes
d
Isn't there a shorter way for such a common pattern?
d
flatMapMerge
is a bit of a hack. I'd recommend not using it for concurrency and just do
async
yourself.
d
Thanks! Good reference... is there any mention of why its a hack there and why async would be better?
d
d
Ok, now I got you, but in the meantime I don't see why https://github.com/Kotlin/kotlinx.coroutines/issues/1147#issuecomment-487531313
shouldn't be a partial solution... the name makes it pretty explicit...
d
Yeah it's not too bad.
d
Just wondering what bufferSize is for if there's concurrencyLevel param...?
It seems like the implementation has to be adapted a little since buffer() was added, but I can't seem to add that too?