async

val <T> suspend () -> T.async: Deferred<T>

Extension property on a suspend function that allows it to be called asynchronously. The result of the suspend function is wrapped in a Deferred object.

Example usage:

suspend fun calculate(): Int = 2 + 2
val result = calculate().async
println(result.await()) // prints 4