Docs for startCoroutineUninterceptedOrReturn
This commit is contained in:
committed by
Denis Zharkov
parent
230564fb4a
commit
9a71a20ad6
@@ -19,6 +19,13 @@
|
|||||||
package kotlin.coroutines.experimental.intrinsics
|
package kotlin.coroutines.experimental.intrinsics
|
||||||
import kotlin.coroutines.experimental.*
|
import kotlin.coroutines.experimental.*
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts unintercepted coroutine without 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 later case, the [completion] continuation is invoked when coroutine completes with result or exception.
|
||||||
|
* This function is designed to be used from inside of [suspendCoroutineOrReturn] to resume the execution of suspended
|
||||||
|
* coroutine using a reference to the suspending function.
|
||||||
|
*/
|
||||||
@SinceKotlin("1.1")
|
@SinceKotlin("1.1")
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
@kotlin.internal.InlineOnly
|
@kotlin.internal.InlineOnly
|
||||||
@@ -26,6 +33,13 @@ public inline fun <T> (suspend () -> T).startCoroutineUninterceptedOrReturn(
|
|||||||
completion: Continuation<T>
|
completion: Continuation<T>
|
||||||
): Any? = (this as Function1<Continuation<T>, Any?>).invoke(completion)
|
): Any? = (this as Function1<Continuation<T>, Any?>).invoke(completion)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts 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 later case, the [completion] continuation is invoked when coroutine completes with result or exception.
|
||||||
|
* This function is designed to be used from inside of [suspendCoroutineOrReturn] to resume the execution of suspended
|
||||||
|
* coroutine using a reference to the suspending function.
|
||||||
|
*/
|
||||||
@SinceKotlin("1.1")
|
@SinceKotlin("1.1")
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
@kotlin.internal.InlineOnly
|
@kotlin.internal.InlineOnly
|
||||||
|
|||||||
Reference in New Issue
Block a user