https://kotlinlang.org logo
#coroutines
Title
# coroutines
b

bj0

02/27/2018, 4:15 PM
@elizarov oh ok, I didn't know the behavior of
withContext
was different, is that difference documented?
e

elizarov

02/27/2018, 7:01 PM
Yes. In their respective docs. It is worth mentioning somewhere else, too, though
You don’t have to memorize that, through. Just note the fact that both
launch
and
async
are regular (non suspending), while
withContext
is a suspending function. All suspending functions respect the cancellation of the context they are invoked in.
b

bj0

02/27/2018, 7:04 PM
Ah yea, that makes sense
2 Views