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

Extensions for org.apache.tuweni.concurrent.AsyncResult

asDeferred

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

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

await

Awaits for completion of the AsyncResult without blocking a thread.

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