Skip to main content
java

Handling Events

How to subscribe to events, assuming you have already started listening.

Connection

val callbacksId = "CALLBACKS_ID"

connection.registerCallback(
callbacksId,
EventType.ConnectedEvent
){
// some actions when lib connect
}

connection.registerCallback(
callbacksId,
EventType.DisconnectedEvent
){
// some actions when lib disconnects
}

Threads

val callbacksId = "CALLBACKS_ID"

connection.registerCallback(
callbacksId,
EventType.ThreadCreatedEvent
){ newThreadData ->
// some actions when new thread created
}

connection.registerCallback(
callbacksId,
EventType.ThreadUpdatedEvent
){ threadUpdateData ->
// some actions when thread updated
}

connection.registerCallback(
callbacksId,
EventType.ThreadStatsChangedEvent
){ threadStatsUpdateData ->
// some actions when thread stats changed
}

connection.registerCallback(
callbacksId,
EventType.ThreadDeletedEvent
){ deletedThreadData ->
// some actions when thread deleted
}

Read more about Thread events.

Stores

val callbacksId = "CALLBACKS_ID"

connection.registerCallback(
callbacksId,
EventType.StoreCreatedEvent
){ newStoreData ->
// some actions when new store created
}

connection.registerCallback(
callbacksId,
EventType.StoreUpdatedEvent
){ storeUpdateData ->
// some actions when store updated
}

connection.registerCallback(
callbacksId,
EventType.StoreStatsChangedEvent
){ storeStatsUpdateData ->
// some actions when store stats changed
}

connection.registerCallback(
callbacksId,
EventType.StoreDeletedEvent
){ deletedStoreData ->
// some actions when store deleted
}

Read more about Store events.

Inboxes

val callbacksId = "CALLBACKS_ID"

connection.registerCallback(
callbacksId,
EventType.InboxCreatedEvent
){ newInboxData ->
// some actions when new inbox created
}

connection.registerCallback(
callbacksId,
EventType.InboxUpdatedEvent
){ inboxUpdateData ->
// some actions when inbox updated
}

connection.registerCallback(
callbacksId,
EventType.InboxDeletedEvent
){ deletedInboxData ->
// some actions when inbox deleted
}