kotlin-flow-extensions / hu.akarnokd.kotlin.flow / Resumable

Resumable

open class Resumable : AtomicReference<Continuation<Any>>

Primitive for suspending and resuming coroutines on demand

Constructors

<init>

Resumable()

Primitive for suspending and resuming coroutines on demand

Functions

await

suspend fun await(): Unit

Await the resumption of this Resumable, suspending the current coroutine if necessary. Only one thread can call this method.

resume

fun resume(): Unit

Resume this Resumable, resuming any currently suspended await callers. This method can be called by any number of threads.