PrivMX DOCS
API Reference/PrivMX Endpoint Java Extra/Core

EventDispatcher

Implements a list of registered event callbacks.

Constructors

EventDispatcher

Creates instance of EventDispatcher.

Params

onRemoveSubscriptionEntry

EventCallback<Map<List<String>>>

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

public void EventDispatcher(
EventCallback<Map<List<String>>> onRemoveSubscriptionEntry
)

Methods

emit

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

Params

event

Event<T>

event data to emit

public <T> void emit(
Event<T> event
)

registerCallback

Registers new event callback.

Params

callbackRegistration

CallbackRegistration<?>

object describing single callback registration

public EventRegistrationInfo registerCallback(
CallbackRegistration<?> callbackRegistration
)

Returns

EventRegistrationInfo · this callback registration info

removeNotSubscribedEvents

Removes all events, excluding internal library events, that do not have subscriptionId.

public void removeNotSubscribedEvents()

unbind

Removes all callbacks registered by #registerCallback(CallbackRegistration). It's identified by given callbackGroups.

Params

callbackGroups

Object[]

one or more callback group identifiers used to select callbacks to unbind

public void unbind(
Object[] callbackGroups
)

unbindAll

Removes all callbacks.

public void unbindAll()

We use cookies on our website. We use them to ensure proper functioning of the site and, if you agree, for purposes such as analytics, marketing, and targeting ads.

EventDispatcher | PrivMX Docs