Module io.inverno.mod.http.server
Package io.inverno.mod.http.server.ws
Interface WebSocketExchange.Outbound
- Enclosing interface:
- WebSocketExchange<A extends ExchangeContext>
public static interface WebSocketExchange.Outbound
Represents the outbound part of a WebSocket exchange.
It allows to set the stream of frames or messages that must be sent to the client. It is only possible to specify either a stream of frames or a stream of messages.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptionvoidframes(Function<WebSocketFrame.Factory, org.reactivestreams.Publisher<WebSocketFrame>> frames) Specifies the stream of frames sent to the client.voidmessages(Function<WebSocketMessage.Factory, org.reactivestreams.Publisher<WebSocketMessage>> messages) Specifies the stream of messages sent to the client.
-
Method Details
-
frames
Specifies the stream of frames sent to the client.
WebSocket frames should be created using the provided
WebSocketFrame.Factory.- Parameters:
frames- a function that returns a publisher of WebSocket frames created using the provided factory
-
messages
void messages(Function<WebSocketMessage.Factory, org.reactivestreams.Publisher<WebSocketMessage>> messages) Specifies the stream of messages sent to the client.
WebSocket messages should be created using the provided
WebSocketMessage.Factory.- Parameters:
messages- a function that returns a publisher of WebSocket messages created using the provided factory
-