open class Resumable : AtomicReference<Continuation<Any>>
Primitive for suspending and resuming coroutines on demand
Resumable()
Primitive for suspending and resuming coroutines on demand |
suspend fun await(): Unit
Await the resumption of this Resumable, suspending the current coroutine if necessary. Only one thread can call this method. |
|
fun resume(): Unit
Resume this Resumable, resuming any currently suspended await callers. This method can be called by any number of threads. |
open class BufferingResumableCollector<T> : Resumable
A collector that can buffer a fixed number of items and drain it with much less need to coordinate the resumption per items. |
|
open class ResumableCollector<T> : Resumable
A collector that hosts a signal (value/error/completion) and allows waiting for the signal and a consumer to be ready to receive them. |