async

suspend fun <R> async(operation: suspend () -> R): Deferred<R>

Run the provided operation asynchronously, returning whatever result is returned by the operation.

The operation is executed against the default dispatcher (Dispatchers.Default).

Return

Deferred task providing the result of the operation.

Parameters

R

Return type.

operation

Operation to run. Can suspend.