Join Slack
Powered by
why does `launch` exist if `async` can return Unit...
# coroutines
u
ursus
08/28/2019, 4:19 AM
why does
launch
exist if
async
can return Unit?
b
basher
08/28/2019, 4:26 AM
Also has differences in exception handling:
https://stackoverflow.com/questions/46226518/what-is-the-difference-between-launch-join-and-async-await-in-kotlin-coroutines#46226519
u
ursus
08/28/2019, 6:17 AM
still dont see why launch exists
g
gildor
08/28/2019, 6:32 AM
Because they have different semantics, async throws exception on place where result is requested, launch throws if exception happened. Both make sense but for different cases, for launch do
run and forget
is fine, for async is not fine
4
Views
Open in Slack
Previous
Next