EventDispatcher

class EventDispatcher(onRemoveSubscriptionEntry: (removedSubscriptions: Map<EventDispatcher.SubscriptionModule, List<String>>) -> Unit)

Implements a list of registered event callbacks.

Parameters

onRemoveSubscriptionEntry

callback triggered when all events from channel entry have been removed (it can also unsubscribe from the channel)

Constructors

Link copied to clipboard
constructor(onRemoveSubscriptionEntry: (removedSubscriptions: Map<EventDispatcher.SubscriptionModule, List<String>>) -> Unit)

Types

Link copied to clipboard

Available subscription modules for event handling.

Functions

Link copied to clipboard
suspend fun <T : Any> emit(event: Event<out T>)

Emits specified event. It should only be called by event loops.

Link copied to clipboard
suspend fun registerCallback(callbackRegistration: CallbackRegistration<out Any>): EventRegistrationInfo

Registers new event callback.

Link copied to clipboard

Removes all events, excluding internal library events, that do not have {@code subscriptionId}.

Link copied to clipboard
suspend fun unbind(vararg callbackGroups: Any)

Removes all callbacks registered by EventDispatcher.register. It's identified by given callback group identifiers.

Link copied to clipboard
suspend fun unbindAll()

Removes all callbacks.