Package kotlin.coroutines.experimental.intrinsics

Platform and version requirements: Kotlin 1.1

Low-level building blocks for libraries that provide coroutine-based APIs.

Properties

COROUTINE_SUSPENDED

val COROUTINE_SUSPENDED: Any

This value is used as a return value of suspendCoroutineOrReturn block argument to state that the execution was suspended and will not return any result immediately.

Functions

createCoroutineUnchecked

fun <T> (suspend () -> T).createCoroutineUnchecked(
    completion: Continuation<T>
): Continuation<Unit>
fun <R, T> (suspend R.() -> T).createCoroutineUnchecked(
    receiver: R,
    completion: Continuation<T>
): Continuation<Unit>

startCoroutineUninterceptedOrReturn

fun <T> (suspend () -> T).startCoroutineUninterceptedOrReturn(
    completion: Continuation<T>
): Any?
fun <R, T> (suspend R.() -> T).startCoroutineUninterceptedOrReturn(
    receiver: R,
    completion: Continuation<T>
): Any?

suspendCoroutineOrReturn

suspend fun <T> suspendCoroutineOrReturn(
    block: (Continuation<T>) -> Any?
): T

Obtains the current continuation instance inside suspend functions and either suspend currently running coroutine or return result immediately without suspension.