tuweni / org.apache.tuweni.concurrent.coroutines / org.apache.tuweni.concurrent.AsyncResult

Extensions for org.apache.tuweni.concurrent.AsyncResult

asDeferred

fun <T> AsyncResult<T>.asDeferred(): Deferred<T>

Converts this AsyncResult to an instance of Deferred. The AsyncResult is cancelled when the resulting deferred is cancelled.

await

suspend fun <T> AsyncResult<T>.await(): T

Awaits for completion of the AsyncResult without blocking a thread.