A friendly reminder: <https://stackoverflow.com/qu...
# coroutines
e
Would you say
launch
is a
CoroutineBuilder
designed to work similar to a threads behavior on Java? They are “fire and forget”, and swallow errors with the caveat that child `Job`s cancel parents with a
Throwable
. While
async
is a
CoroutineBuilder
designed to work like C#’s async/await, and expects a value returned, even if its an error similar to java futures with
Deferred
e
Yes.
e
If
launch
and
async
are considered essential “base” builders, is there a performance overhead to implement
CompletableFuture
, or other frameworks wrapped in the
suspendedCoroutine
builder? I understand the benefit of converting a blocking callback to a suspending callback, but I don’t realize the cost compared to
launch
and
async
, builders which seem to only denote a preference in error return.
e
They are not base builders. Base builder is
startCoroutine
from stdlib. All other builders are implemented on top of it:
launch
,
async
,
futures
, etc are all equally high-level builders. Their impls even follow the same pattern.
👍 2