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

ursus

08/28/2019, 4:19 AM
why does
launch
exist if
async
can return Unit?
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