Package kotlin.coroutines.intrinsics

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

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

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

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

Functions

createCoroutineUnintercepted
Link copied to clipboard
expect fun <T> suspend () -> T.createCoroutineUnintercepted(completion: Continuation<T>): Continuation<Unit>
expect fun <R, T> suspend R.() -> T.createCoroutineUnintercepted(receiver: R, completion: Continuation<T>): Continuation<Unit>
actual fun <T> suspend () -> T.createCoroutineUnintercepted(completion: Continuation<T>): Continuation<Unit>

Creates unintercepted coroutine without receiver and with result type T. This function creates a new, fresh instance of suspendable computation every time it is invoked.

Since Kotlin

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

Creates unintercepted coroutine with receiver type R and result type T. This function creates a new, fresh instance of suspendable computation every time it is invoked.

Since Kotlin

1.3
actual fun <T> suspend () -> T.createCoroutineUnintercepted(completion: Continuation<T>): Continuation<Unit>

Creates unintercepted coroutine without receiver and with result type T. This function creates a new, fresh instance of suspendable computation every time it is invoked.

Since Kotlin

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

Creates unintercepted coroutine with receiver type R and result type T. This function creates a new, fresh instance of suspendable computation every time it is invoked.

Since Kotlin

1.3
actual fun <T> suspend () -> T.createCoroutineUnintercepted(completion: Continuation<T>): Continuation<Unit>

Creates unintercepted coroutine without receiver and with result type T. This function creates a new, fresh instance of suspendable computation every time it is invoked.

Since Kotlin

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

Creates unintercepted coroutine with receiver type R and result type T. This function creates a new, fresh instance of suspendable computation every time it is invoked.

Since Kotlin

1.3
intercepted
Link copied to clipboard
expect fun <T> Continuation<T>.intercepted(): Continuation<T>

Intercepts this continuation with ContinuationInterceptor.

Since Kotlin

1.3
actual fun <T> Continuation<T>.intercepted(): Continuation<T>

Intercepts this continuation with ContinuationInterceptor.

Since Kotlin

1.3
actual fun <T> Continuation<T>.intercepted(): Continuation<T>

Intercepts this continuation with ContinuationInterceptor.

Since Kotlin

1.3
actual fun <T> Continuation<T>.intercepted(): Continuation<T>

Intercepts this continuation with ContinuationInterceptor.

Since Kotlin

1.3
startCoroutineUninterceptedOrReturn
Link copied to clipboard
expect inline fun <T> suspend () -> T.startCoroutineUninterceptedOrReturn(completion: Continuation<T>): Any?

Starts an unintercepted coroutine without a receiver and with result type T and executes it until its first suspension. Returns the result of the coroutine or throws its exception if it does not suspend or COROUTINE_SUSPENDED if it suspends. In the latter case, the completion continuation is invoked when the coroutine completes with a result or an exception.

Since Kotlin

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

Starts an unintercepted coroutine with receiver type R and result type T and executes it until its first suspension. Returns the result of the coroutine or throws its exception if it does not suspend or COROUTINE_SUSPENDED if it suspends. In the latter case, the completion continuation is invoked when the coroutine completes with a result or an exception.

Since Kotlin

1.3
actual inline fun <T> suspend () -> T.startCoroutineUninterceptedOrReturn(completion: Continuation<T>): Any?

Starts an unintercepted coroutine without a receiver and with result type T and executes it until its first suspension. Returns the result of the coroutine or throws its exception if it does not suspend or COROUTINE_SUSPENDED if it suspends. In the latter case, the completion continuation is invoked when the coroutine completes with a result or an exception.

Since Kotlin

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

Starts an unintercepted coroutine with receiver type R and result type T and executes it until its first suspension. Returns the result of the coroutine or throws its exception if it does not suspend or COROUTINE_SUSPENDED if it suspends. In the latter case, the completion continuation is invoked when the coroutine completes with a result or an exception.

Since Kotlin

1.3
actual inline fun <T> suspend () -> T.startCoroutineUninterceptedOrReturn(completion: Continuation<T>): Any?

Starts an unintercepted coroutine without a receiver and with result type T and executes it until its first suspension. Returns the result of the coroutine or throws its exception if it does not suspend or COROUTINE_SUSPENDED if it suspends. In the latter case, the completion continuation is invoked when the coroutine completes with a result or an exception.

Since Kotlin

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

Starts an unintercepted coroutine with receiver type R and result type T and executes it until its first suspension. Returns the result of the coroutine or throws its exception if it does not suspend or COROUTINE_SUSPENDED if it suspends. In the latter case, the completion continuation is invoked when the coroutine completes with a result or an exception.

Since Kotlin

1.3
actual inline fun <T> suspend () -> T.startCoroutineUninterceptedOrReturn(completion: Continuation<T>): Any?

Starts an unintercepted coroutine without a receiver and with result type T and executes it until its first suspension. Returns the result of the coroutine or throws its exception if it does not suspend or COROUTINE_SUSPENDED if it suspends. In the latter case, the completion continuation is invoked when the coroutine completes with a result or an exception.

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

Starts an unintercepted coroutine with receiver type R and result type T and executes it until its first suspension. Returns the result of the coroutine or throws its exception if it does not suspend or COROUTINE_SUSPENDED if it suspends. In the latter case, the completion continuation is invoked when the coroutine completes with a result or an exception.

suspendCoroutineUninterceptedOrReturn
Link copied to clipboard
inline suspend fun <T> suspendCoroutineUninterceptedOrReturn(crossinline block: (Continuation<T>) -> Any?): T

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

Since Kotlin

1.3

Properties

COROUTINE_SUSPENDED
Link copied to clipboard
val COROUTINE_SUSPENDED: Any

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