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 java.lang.Object
Constructor and Description |
---|
MappedWebSocketAcceptor(scala.PartialFunction<Message,F.Either<In,Message>> inMapper,
java.util.function.Function<Out,Message> outMapper) |
Modifier and Type | Method and Description |
---|---|
WebSocket |
accept(java.util.function.Function<Http.RequestHeader,akka.stream.javadsl.Flow<In,Out,?>> f)
Accept a WebSocket.
|
WebSocket |
acceptOrResult(java.util.function.Function<Http.RequestHeader,java.util.concurrent.CompletionStage<F.Either<Result,akka.stream.javadsl.Flow<In,Out,?>>>> f)
Accept a WebSocket.
|
public WebSocket acceptOrResult(java.util.function.Function<Http.RequestHeader,java.util.concurrent.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(java.util.function.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.