In
- the type the websocket reads from clients (e.g. String, JsonNode)Out
- the type the websocket outputs back to remote clients (e.g. String, JsonNode)public static class WebSocket.MappedWebSocketAcceptor<In,Out> extends Object
Constructor and Description |
---|
MappedWebSocketAcceptor(scala.PartialFunction<Message,F.Either<In,Message>> inMapper,
Function<Out,Message> outMapper) |
Modifier and Type | Method and Description |
---|---|
WebSocket |
accept(Function<Http.RequestHeader,akka.stream.javadsl.Flow<In,Out,?>> f)
Accept a WebSocket.
|
WebSocket |
acceptOrResult(Function<Http.RequestHeader,CompletionStage<F.Either<Result,akka.stream.javadsl.Flow<In,Out,?>>>> f)
Accept a WebSocket.
|
public WebSocket acceptOrResult(Function<Http.RequestHeader,CompletionStage<F.Either<Result,akka.stream.javadsl.Flow<In,Out,?>>>> f)
f
- A function that takes the request header, and returns a future of either the result
to reject the WebSocket connection with, or a flow to handle the WebSocket messages.public WebSocket accept(Function<Http.RequestHeader,akka.stream.javadsl.Flow<In,Out,?>> f)
f
- A function that takes the request header, and returns a flow to handle the WebSocket
messages.