coroutineToFuture

fun <T> CoroutineScope.coroutineToFuture(context: CoroutineContext = EmptyCoroutineContext, start: CoroutineStart = CoroutineStart.DEFAULT, block: suspend CoroutineScope.() -> T): Future<T>(source)

Launch a coroutine and converts it into a Future that completes when the suspended function returns and fails if it throws.