Continuation

interface Continuation<in T>

Interface representing a continuation after a suspension point that returns a value of type T.

Since Kotlin

1.3

Functions

resumeWith
Link copied to clipboard
abstract fun resumeWith(result: Result<T>)

Resumes the execution of the corresponding coroutine passing a successful or failed result as the return value of the last suspension point.

Properties

context
Link copied to clipboard
abstract val context: CoroutineContext

The context of the coroutine that corresponds to this continuation.

Extensions

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

Intercepts this continuation with ContinuationInterceptor.

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

Intercepts this continuation with ContinuationInterceptor.

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

Intercepts this continuation with ContinuationInterceptor.

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

Intercepts this continuation with ContinuationInterceptor.

resume
Link copied to clipboard
inline fun <T> Continuation<T>.resume(value: T)

Resumes the execution of the corresponding coroutine passing value as the return value of the last suspension point.

resumeWithException
Link copied to clipboard
inline fun <T> Continuation<T>.resumeWithException(exception: Throwable)

Resumes the execution of the corresponding coroutine so that the exception is re-thrown right after the last suspension point.