Interface WebsocketEndpoint
- All Known Implementing Classes:
AbstractWebsocketClient, WebSocketEventStoreClient, WebsocketGatewayClient, WebsocketKeyValueClient, WebsocketSchedulingClient, WebSocketSearchClient, WebsocketTrackingClient
public interface WebsocketEndpoint
Callback contract for low-level Fluxzero runtime websocket sessions.
Implementations should return quickly from these callbacks. Higher-level Fluxzero clients dispatch expensive result handling onto worker executors so transport callbacks do not block the underlying WebSocket implementation.
-
Method Summary
Modifier and TypeMethodDescriptionvoidonClose(WebsocketSession session, WebsocketCloseReason closeReason) Called once when a session closes or is aborted.voidonError(WebsocketSession session, Throwable error) Called when the underlying WebSocket implementation reports an error.voidonMessage(byte[] bytes, WebsocketSession session) Called when a complete binary message has been received.voidonOpen(WebsocketSession session) Called after the opening handshake has completed and the session metadata is available.voidonPong(ByteBuffer data, WebsocketSession session) Called when a pong frame has been received.
-
Method Details
-
onOpen
Called after the opening handshake has completed and the session metadata is available.- Parameters:
session- the newly opened session
-
onMessage
Called when a complete binary message has been received.- Parameters:
bytes- the full binary message payloadsession- the session that received the message
-
onPong
Called when a pong frame has been received.- Parameters:
data- the pong application datasession- the session that received the pong
-
onClose
Called once when a session closes or is aborted.- Parameters:
session- the closed sessioncloseReason- the close status and optional reason
-
onError
Called when the underlying WebSocket implementation reports an error.- Parameters:
session- the session that failederror- the reported error
-