tuweni / org.apache.tuweni.concurrent.coroutines

Package org.apache.tuweni.concurrent.coroutines

Extensions for mapping AsyncResult and AsyncCompletion objects to and from Kotlin coroutines.

Types

CoroutineLatch

class CoroutineLatch

A co-routine synchronization aid that allows co-routines to wait until a set of operations being performed has completed.

Extensions for External Classes

kotlinx.coroutines.CoroutineScope

kotlinx.coroutines.Deferred

kotlinx.coroutines.Job

org.apache.tuweni.concurrent.AsyncCompletion

org.apache.tuweni.concurrent.AsyncResult

Functions

timeoutAndRetry

suspend fun <R> timeoutAndRetry(timeout: Long, block: suspend (Int) -> R?): R
suspend fun <R> timeoutAndRetry(timeout: Long, maxRetries: Int, block: suspend (Int) -> R?): R?
suspend fun <R> timeoutAndRetry(timeout: (Int) -> Long?, block: suspend (Int) -> R?): R?

Cancel and retry a suspending block until a non-null result is obtained.