globalEventChannel

fun CoroutineScope.globalEventChannel(coroutineContext: CoroutineContext = EmptyCoroutineContext): EventChannel<Event>

在此 CoroutineScope 下创建一个监听所有事件的 EventChannel. 相当于 GlobalEventChannel.parentScope(this).context(coroutineContext).

在返回的 EventChannel 中的事件监听器都会以 this 作为父协程作用域. 即会 使用 this

Parameters

coroutineContext

Throws