runInPromise

inline fun <T> runInPromise(scope: CoroutineScope, context: CoroutineContext = EmptyCoroutineContext, crossinline block: suspend CoroutineScope.() -> T): Promise<T>(source)

执行一个异步函数,得到 Promise.


inline fun <T> runInPromise(context: CoroutineContext = EmptyCoroutineContext, crossinline block: suspend CoroutineScope.() -> T): Promise<T>(source)

使用 GlobalScope 执行一个异步函数,得到 Promise.