All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kotlin.coroutines.experimental.CoroutinesIntrinsicsExperimentalH.kt Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
 * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
 */

package kotlin.coroutines.experimental.intrinsics

import kotlin.coroutines.experimental.Continuation

/**
 * 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 latter 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 a suspended
 * coroutine using a reference to the suspending function.
 */
@SinceKotlin("1.1")
public expect inline fun  (suspend () -> T).startCoroutineUninterceptedOrReturn(
    completion: Continuation
): Any?

/**
 * 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 latter 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 a suspended
 * coroutine using a reference to the suspending function.
 */
@SinceKotlin("1.1")
public expect inline fun  (suspend R.() -> T).startCoroutineUninterceptedOrReturn(
    receiver: R,
    completion: Continuation
): Any?

@SinceKotlin("1.1")
public expect fun  (suspend () -> T).createCoroutineUnchecked(
    completion: Continuation
): Continuation

@SinceKotlin("1.1")
public expect fun  (suspend R.() -> T).createCoroutineUnchecked(
    receiver: R,
    completion: Continuation
): Continuation




© 2015 - 2024 Weber Informatics LLC | Privacy Policy