subscribeTo
open override fun <T : Any> EventReceiver.subscribeTo(clazz: KClass<T>, priority: Priority, ignoreCancelled: Boolean, skipRetained: Boolean, callback: suspend T.() -> Unit): EventReceiver
Subscribe to events that are type of clazz with the given callback function. The callback can be called immediately if event of type clazz is present in the flow.
Return
This instance of EventReceiver for chaining
Parameters
clazz
Type of event to subscribe to
priority
Priority of the event.
ignoreCancelled
If true, the callback will not be called if the event is cancelled.
skipRetained
Skips event already present in the flow. This is false
by default.
callback
The callback function.
open override fun <T : Any> EventReceiver.subscribeTo(clazz: KClass<T>, callback: EventCallback<T>): EventReceiver
A variant of subscribeTo that uses an instance of EventCallback as callback.
Return
This instance of EventReceiver for chaining
See also
Parameters
clazz
Type of event to subscribe to
callback
The callback information.