SimpleListenerHost

abstract class SimpleListenerHost constructor(coroutineContext: CoroutineContext = EmptyCoroutineContext) : ListenerHost, CoroutineScope

携带一个异常处理器的 ListenerHost.

See also

查看更多信息

查看更多信息

Constructors

Link copied to clipboard
constructor(coroutineContext: CoroutineContext = EmptyCoroutineContext)

Functions

Link copied to clipboard
fun cancelAll()

停止所有事件监听

Link copied to clipboard
fun CoroutineScope.globalEventChannel(coroutineContext: CoroutineContext = EmptyCoroutineContext): EventChannel<Event>

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

Link copied to clipboard
open fun handleException(context: CoroutineContext, exception: Throwable)

处理事件处理中未捕获的异常. 在构造器中的 coroutineContext 未提供 CoroutineExceptionHandler 情况下必须继承此函数.

Properties

Link copied to clipboard