Sam Garfinkel
07/31/2020, 4:56 PMdoSomething()
in this snippet prevents the outer run()
loop from continuing? You’ll notice that "Continuing to run"
is printed after "doSomething with $hello done"
which is the opposite pattern I’m looking for.Zach Klippenstein (he/him) [MOD]
07/31/2020, 5:00 PMSam Garfinkel
07/31/2020, 5:01 PMcoroutineScope
into the outer run()
?octylFractal
07/31/2020, 5:04 PMsuspend
and coroutineScope
and make it an extension on CoroutineScope
insteadasync {}
(or launch if you don't need results)Sam Garfinkel
07/31/2020, 5:08 PMZach Klippenstein (he/him) [MOD]
07/31/2020, 5:11 PMdoSomethingIn
. Receiver feels odd to me unless the function is a generic launcher or something, and this convention reads really clearly that this function will launch a coroutine in a given scope. But same idea regardless.Sam Garfinkel
07/31/2020, 5:16 PM