FunctionalBindableEventListener

abstract class FunctionalBindableEventListener(instance: Any?, val caller: KFunction<*>, dispatcherContext: CoroutineContext = Dispatchers.IO) : FunctionalEventListener(source)

可以进行动态参数绑定的 FunctionalEventListener, 可以通过 binderscaller 进行参数绑定。

invoke 中,如果 caller 是可挂起的(isSuspend = true), 则通过可挂起执行。 如果不是可挂起的,则会通过 runInterruptible 在可中断中普通执行。 runInterruptible 会使用 dispatcherContext 作为调度器。

Constructors

Link copied to clipboard
constructor(instance: Any?, caller: KFunction<*>, dispatcherContext: CoroutineContext = Dispatchers.IO)

Properties

Link copied to clipboard
override val caller: KFunction<*>

当前监听函数所对应的执行器。

Functions

Link copied to clipboard
open suspend override fun EventListenerContext.handle(): EventResult

函数执行。