Platform and version requirements: Kotlin 1.1
Library support for coroutines, including support for lazy sequences.
abstract class AbstractCoroutineContextElement : Element Base class for CoroutineContext.Element implementations. | |
interface Continuation<in T> Interface representing a continuation after a suspension point that returns value of type | |
interface ContinuationInterceptor : Element 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 CoroutineContext Persistent context for the coroutine. It is an indexed set of Element instances. An indexed set is a mix between a set and a map. Every element in this set has a unique Key. Keys are compared by reference. | |
object EmptyCoroutineContext : CoroutineContext An empty coroutine context. | |
abstract class SequenceBuilder<in T> Builder for a Sequence or an Iterator, provides yield and yieldAll suspension functions. |
annotation class RestrictsSuspension Classes and interfaces marked with this annotation are restricted when used as receivers for extension |
fun <T> buildIterator( builderAction: suspend SequenceBuilder<T>.() -> Unit ): Iterator<T> Builds an Iterator lazily yielding values one by one. | |
fun <T> buildSequence( builderAction: suspend SequenceBuilder<T>.() -> Unit ): Sequence<T> Builds a Sequence lazily yielding values one by one. | |
fun <R, T> (suspend R.() -> T).createCoroutine( receiver: R, completion: Continuation<T> ): Continuation<Unit> 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 <T> (suspend () -> T).createCoroutine( 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 <R, T> (suspend R.() -> T).startCoroutine( receiver: R, completion: Continuation<T>) 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 <T> (suspend () -> T).startCoroutine( 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. | |
suspend fun <T> suspendCoroutine( block: (Continuation<T>) -> Unit ): T Obtains the current continuation instance inside suspend functions and suspends currently running coroutine. |
© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines.experimental/