Class WebSocket
java.lang.Object
org.apache.pekko.http.impl.engine.ws.WebSocket
INTERNAL API
Defines components of the websocket stack.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.pekko.stream.scaladsl.BidiFlow<FrameEventOrError,FrameHandler.Output, Object, FrameStart, org.apache.pekko.NotUsed> frameHandling(boolean serverSide, scala.concurrent.duration.FiniteDuration closeTimeout, org.apache.pekko.event.LoggingAdapter log) The layer that implements all low-level frame handling, like handling control frames, collecting messages from frames, decoding text messages, close handling, etc.static org.apache.pekko.stream.scaladsl.BidiFlow<org.apache.pekko.util.ByteString,FrameEvent, FrameEvent, org.apache.pekko.util.ByteString, org.apache.pekko.NotUsed> framing()The lowest layer that implements the binary protocolstatic org.apache.pekko.stream.scaladsl.BidiFlow<FrameEventOrError,FrameEventOrError, FrameEvent, FrameEvent, org.apache.pekko.NotUsed> idleTimeout(WebSocketSettings settings) The layer that transparently monitors frames in both directions and fails the flow with aWebSocketIdleTimeoutExceptionif no frame is passed within the configured time.static org.apache.pekko.stream.scaladsl.BidiFlow<FrameEvent,FrameEventOrError, FrameEvent, FrameEvent, org.apache.pekko.NotUsed> The layer that handles masking using the rules defined in the specificationstatic org.apache.pekko.stream.scaladsl.BidiFlow<FrameHandler.Output,Message, Message, Object, org.apache.pekko.NotUsed> messageAPI(boolean serverSide, scala.concurrent.duration.FiniteDuration closeTimeout) The layer that provides the high-level user facing API on top of frame handling.static org.apache.pekko.stream.scaladsl.BidiFlow<FrameHandler.Output,FrameHandler.Output, Object, Object, org.apache.pekko.NotUsed> periodicKeepAlive(WebSocketSettings settings) The layer that transparently injects (if enabled) keepAlive Ping or Pong messages when connection is idlestatic org.apache.pekko.stream.scaladsl.BidiFlow<FrameEvent,Message, Message, FrameEvent, org.apache.pekko.NotUsed> stack(boolean serverSide, WebSocketSettings websocketSettings, scala.Option<PerMessageDeflate.Negotiated> perMessageDeflate, org.apache.pekko.event.LoggingAdapter log, scala.Function1<Message, Object> shouldCompress) static org.apache.pekko.stream.scaladsl.BidiFlow<FrameEvent,Message, Message, FrameEvent, org.apache.pekko.NotUsed> stack(boolean serverSide, WebSocketSettings websocketSettings, scala.Option<PerMessageDeflate.Negotiated> perMessageDeflate, scala.concurrent.duration.FiniteDuration closeTimeout, org.apache.pekko.event.LoggingAdapter log) A stack of all the higher WS layers between raw frames and the user API.static org.apache.pekko.stream.scaladsl.BidiFlow<FrameEvent,Message, Message, FrameEvent, org.apache.pekko.NotUsed> stack(boolean serverSide, WebSocketSettings websocketSettings, scala.Option<PerMessageDeflate.Negotiated> perMessageDeflate, scala.concurrent.duration.FiniteDuration closeTimeout, org.apache.pekko.event.LoggingAdapter log, scala.Function1<Message, Object> shouldCompress)
-
Constructor Details
-
WebSocket
public WebSocket()
-
-
Method Details
-
stack
public static org.apache.pekko.stream.scaladsl.BidiFlow<FrameEvent,Message, stackMessage, FrameEvent, org.apache.pekko.NotUsed> (boolean serverSide, WebSocketSettings websocketSettings, scala.Option<PerMessageDeflate.Negotiated> perMessageDeflate, scala.concurrent.duration.FiniteDuration closeTimeout, org.apache.pekko.event.LoggingAdapter log) A stack of all the higher WS layers between raw frames and the user API.- Parameters:
serverSide- (undocumented)websocketSettings- (undocumented)perMessageDeflate- (undocumented)closeTimeout- (undocumented)log- (undocumented)- Returns:
- (undocumented)
-
stack
public static org.apache.pekko.stream.scaladsl.BidiFlow<FrameEvent,Message, stackMessage, FrameEvent, org.apache.pekko.NotUsed> (boolean serverSide, WebSocketSettings websocketSettings, scala.Option<PerMessageDeflate.Negotiated> perMessageDeflate, org.apache.pekko.event.LoggingAdapter log, scala.Function1<Message, Object> shouldCompress) -
stack
public static org.apache.pekko.stream.scaladsl.BidiFlow<FrameEvent,Message, stackMessage, FrameEvent, org.apache.pekko.NotUsed> (boolean serverSide, WebSocketSettings websocketSettings, scala.Option<PerMessageDeflate.Negotiated> perMessageDeflate, scala.concurrent.duration.FiniteDuration closeTimeout, org.apache.pekko.event.LoggingAdapter log, scala.Function1<Message, Object> shouldCompress) -
framing
public static org.apache.pekko.stream.scaladsl.BidiFlow<org.apache.pekko.util.ByteString,FrameEvent, framing()FrameEvent, org.apache.pekko.util.ByteString, org.apache.pekko.NotUsed> The lowest layer that implements the binary protocol -
masking
public static org.apache.pekko.stream.scaladsl.BidiFlow<FrameEvent,FrameEventOrError, maskingFrameEvent, FrameEvent, org.apache.pekko.NotUsed> (boolean serverSide, scala.Function0<Random> maskingRandomFactory) The layer that handles masking using the rules defined in the specification -
idleTimeout
public static org.apache.pekko.stream.scaladsl.BidiFlow<FrameEventOrError,FrameEventOrError, idleTimeoutFrameEvent, FrameEvent, org.apache.pekko.NotUsed> (WebSocketSettings settings) The layer that transparently monitors frames in both directions and fails the flow with aWebSocketIdleTimeoutExceptionif no frame is passed within the configured time.It sits below frame handling, so that control frames (e.g. a Pong replying to a keep-alive Ping) count as activity.
- Parameters:
settings- (undocumented)- Returns:
- (undocumented)
-
periodicKeepAlive
public static org.apache.pekko.stream.scaladsl.BidiFlow<FrameHandler.Output,FrameHandler.Output, periodicKeepAliveObject, Object, org.apache.pekko.NotUsed> (WebSocketSettings settings) The layer that transparently injects (if enabled) keepAlive Ping or Pong messages when connection is idle -
frameHandling
public static org.apache.pekko.stream.scaladsl.BidiFlow<FrameEventOrError,FrameHandler.Output, frameHandlingObject, FrameStart, org.apache.pekko.NotUsed> (boolean serverSide, scala.concurrent.duration.FiniteDuration closeTimeout, org.apache.pekko.event.LoggingAdapter log) The layer that implements all low-level frame handling, like handling control frames, collecting messages from frames, decoding text messages, close handling, etc.- Parameters:
serverSide- (undocumented)closeTimeout- (undocumented)log- (undocumented)- Returns:
- (undocumented)
-
messageAPI
public static org.apache.pekko.stream.scaladsl.BidiFlow<FrameHandler.Output,Message, messageAPIMessage, Object, org.apache.pekko.NotUsed> (boolean serverSide, scala.concurrent.duration.FiniteDuration closeTimeout) The layer that provides the high-level user facing API on top of frame handling.- Parameters:
serverSide- (undocumented)closeTimeout- (undocumented)- Returns:
- (undocumented)
-