public static interface ServerSession.MessageListener extends ServerSession.ServerSessionListener
Listeners objects that implement this interface will be notified of message sending.
Modifier and Type | Method and Description |
---|---|
default boolean |
onMessage(ServerSession session,
ServerSession sender,
ServerMessage message)
Blocking version of
onMessage(ServerSession, ServerSession, ServerMessage, Promise) . |
default void |
onMessage(ServerSession session,
ServerSession sender,
ServerMessage message,
Promise<Boolean> promise)
Callback invoked when a message is sent.
|
default void onMessage(ServerSession session, ServerSession sender, ServerMessage message, Promise<Boolean> promise)
Callback invoked when a message is sent.
Implementers can decide to notify the promise with false to signal that the message should not be further processed, meaning that other session listeners will not be notified and that the message will be discarded for this session.
session
- the session that will receive the messagesender
- the session that sent the messagemessage
- the message sentpromise
- the promise to notify whether the processing of the message should continuedefault boolean onMessage(ServerSession session, ServerSession sender, ServerMessage message)
Blocking version of onMessage(ServerSession, ServerSession, ServerMessage, Promise)
.
session
- the session that will receive the messagesender
- the session that sent the messagemessage
- the message sentCopyright © 2008–2024 The CometD Project. All rights reserved.