Hi guys, i have problems with some corner cases he...
# coroutines
d
Hi guys, i have problems with some corner cases here within this scope.
e
Here’s a working example that I just put together (note that the signature of doAlgorithm() in my case was
doAlgorithm(Int, Flow<Int>)
). If you invoke the
cancel()
function within your coroutineScope, due to structured concurrency any running coroutines launched within the scope will be cancelled automatically just like the code in the
launch { }
block in this example. You’ll also need the
return@coroutineScope
so
aResult
can be smart-cast to
Int
from
Int?
, as cancel doesn’t immediately cause a return.
d
ok cool thx i am gonna try your hints
👍 1
works perfect thx 🙂
👍 1