public abstract class WebSocket extends Object
Modifier and Type | Class and Description |
---|---|
static class |
WebSocket.MappedWebSocketAcceptor<In,Out>
Utility class for creating WebSockets.
|
Modifier and Type | Field and Description |
---|---|
static WebSocket.MappedWebSocketAcceptor<akka.util.ByteString,akka.util.ByteString> |
Binary
Acceptor for binary WebSockets.
|
static WebSocket.MappedWebSocketAcceptor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode> |
Json
Acceptor for JSON WebSockets.
|
static WebSocket.MappedWebSocketAcceptor<String,String> |
Text
Acceptor for text WebSockets.
|
Constructor and Description |
---|
WebSocket() |
Modifier and Type | Method and Description |
---|---|
abstract CompletionStage<F.Either<Result,akka.stream.javadsl.Flow<Message,Message,?>>> |
apply(Http.RequestHeader request)
Invoke the WebSocket.
|
static <In,Out> WebSocket.MappedWebSocketAcceptor<In,Out> |
json(Class<In> in)
Acceptor for JSON WebSockets.
|
public static final WebSocket.MappedWebSocketAcceptor<String,String> Text
public static final WebSocket.MappedWebSocketAcceptor<akka.util.ByteString,akka.util.ByteString> Binary
public static final WebSocket.MappedWebSocketAcceptor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode> Json
public abstract CompletionStage<F.Either<Result,akka.stream.javadsl.Flow<Message,Message,?>>> apply(Http.RequestHeader request)
request
- The request for the WebSocket.public static <In,Out> WebSocket.MappedWebSocketAcceptor<In,Out> json(Class<In> in)
In
- The websocket's input type (what it receives from clients)Out
- The websocket's output type (what it writes to clients)in
- The class of the incoming messages, used to decode them from the JSON.