kotlin.coroutines.experimental.suspendCoroutine

suspendCoroutine

inline suspend fun <T> suspendCoroutine(
    crossinline block: (Continuation<T>) -> Unit
): T

Platform and version requirements: Kotlin 1.1

Obtains the current continuation instance inside suspend functions and suspends currently running coroutine.

In this function both Continuation.resume and Continuation.resumeWithException can be used either synchronously in the same stack-frame where suspension function is run or asynchronously later in the same thread or from a different thread of execution. Repeated invocation of any resume function produces IllegalStateException.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines.experimental/suspend-coroutine.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部