Deprecated support for experimental coroutines, provided for compatibility. It's recommended to migrate to kotlin.coroutines
API.
Base class for CoroutineContext.Element implementations.
abstract class AbstractCoroutineContextElement : Element
Interface representing a continuation after a suspension point that returns value of type T
.
interface Continuation<in T>
Marks coroutine context element that intercepts coroutine continuations. The coroutines framework uses ContinuationInterceptor.Key to retrieve the interceptor and intercepts all coroutine continuations with interceptContinuation invocations.
interface ContinuationInterceptor : Element
An empty coroutine context.
object EmptyCoroutineContext : CoroutineContext
Classes and interfaces marked with this annotation are restricted when used as receivers for extension suspend
functions. These suspend
extensions can only invoke other member or extension suspend
functions on this particular receiver only and are restricted from calling arbitrary suspension functions.
annotation class RestrictsSuspension
Continuation context of current coroutine.
suspend val coroutineContext: CoroutineContext
Builds an Iterator lazily yielding values one by one.
fun <T> buildIterator( builderAction: suspend SequenceBuilder<T>.() -> Unit ): Iterator<T>
Builds a Sequence lazily yielding values one by one.
fun <T> buildSequence( builderAction: suspend SequenceBuilder<T>.() -> Unit ): Sequence<T>
Creates a coroutine with receiver type R and result type T. This function creates a new, fresh instance of suspendable computation every time it is invoked.
fun <R, T> (suspend R.() -> T).createCoroutine( receiver: R, completion: Continuation<T> ): Continuation<Unit>
Creates a coroutine without receiver and with result type T. This function creates a new, fresh instance of suspendable computation every time it is invoked.
fun <T> (suspend () -> T).createCoroutine( completion: Continuation<T> ): Continuation<Unit>
Starts coroutine with receiver type R and result type T. This function creates and start a new, fresh instance of suspendable computation every time it is invoked. The completion continuation is invoked when coroutine completes with result or exception.
fun <R, T> (suspend R.() -> T).startCoroutine( receiver: R, completion: Continuation<T>)
Starts coroutine without receiver and with result type T. This function creates and start a new, fresh instance of suspendable computation every time it is invoked. The completion continuation is invoked when coroutine completes with result or exception.
fun <T> (suspend () -> T).startCoroutine( completion: Continuation<T>)
Obtains the current continuation instance inside suspend functions and suspends currently running coroutine.
suspend fun <T> suspendCoroutine( block: (Continuation<T>) -> Unit ): T
© 2010–2019 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines.experimental/index.html