concurrent-coroutines / org.apache.tuweni.concurrent.coroutines / org.apache.tuweni.concurrent.AsyncCompletion

Extensions for org.apache.tuweni.concurrent.AsyncCompletion

asDeferred

fun AsyncCompletion.asDeferred(): Deferred<Unit>

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

await

suspend fun AsyncCompletion.await(): Unit

Awaits for completion of the AsyncCompletion without blocking a thread.