Top Description Methods
org.eclipse.jetty.websocket.core.messages

public Interface MessageSink

Known Direct Implementers
org.eclipse.jetty.websocket.core.messages.AbstractMessageSink, org.eclipse.jetty.websocket.core.messages.MessageInputStream, org.eclipse.jetty.websocket.core.messages.MessageReader
Imports
org.eclipse.jetty.util.Callback, org.eclipse.jetty.websocket.core.CoreSession, .Frame, .FrameHandler

A consumer of WebSocket data frames (either BINARY or TEXT).

FrameHandler delegates the processing of data frames to MessageSink, including the processing of the demand for the next frames.

Method Summary

Modifier and TypeMethod and Description
public void
accept(Frame
the frame to consume
frame
,
Callback
the callback to complete when the frame is consumed
callback
)

Consumes the WebSocket frame, possibly asynchronously when this method has returned.

public default void
fail(Throwable
the cause of the failure
failure
)

Fails this MessageSink with the given cause.

Method Detail

acceptback to summary
public void accept(Frame frame, Callback callback)

Consumes the WebSocket frame, possibly asynchronously when this method has returned.

The callback argument must be completed when the frame payload is consumed.

The demand for more frames must be explicitly invoked, or arranged to be invoked asynchronously, by the implementation of this method, by calling CoreSession#demand().

Parameters
frame:Frame

the frame to consume

callback:Callback

the callback to complete when the frame is consumed

failback to summary
public default void fail(Throwable failure)

Fails this MessageSink with the given cause.

Parameters
failure:Throwable

the cause of the failure