Coroutines: The Async Builder
Return Value
The biggest point of difference between async
and launch
is that async
returns a computed value.
The value is returned through a wrapper class called Deferred
.
We can access this result through an await
function.
This function suspends the coroutine until it has finished computing the value. (similar to join
)