class MigratoryDataPresenceListener;

This API interface handles presence events from the MigratoryData cluster.

Thread safety

The methods of this class are always called from the same thread.

Public Functions

Name
void onUserPresence(User user)
Callback function triggered whenever a user connects, disconnects, or updates its subscribed subjects (by subscribing to or unsubscribing from them).
void onClusterMessage(Message message)
Callback method invoked whenever a message is received by the MigratoryData cluster.

Public Functions Documentation

function onUserPresence

void onUserPresence(
    User user
)

Callback function triggered whenever a user connects, disconnects, or updates its subscribed subjects (by subscribing to or unsubscribing from them).

Note: This method is called by all members of the MigratoryData cluster, not just by the cluster member to which the user is connected.

Parameters:

  • user The user whose presence status has changed.

function onClusterMessage

void onClusterMessage(
    Message message
)

Callback method invoked whenever a message is received by the MigratoryData cluster.

Note: This method is invoked by exactly one member within the MigratoryData cluster; consider this member as randomly chosen (even if the selection is based on the message's subject).

Parameters:

  • message The received message.