Package io.deephaven.web.client.api.grpc
Class MultiplexedWebsocketTransport
java.lang.Object
io.deephaven.web.client.api.grpc.MultiplexedWebsocketTransport
- All Implemented Interfaces:
GrpcTransport
Custom replacement for grpc-websockets transport that handles multiple grpc streams in a single websocket. All else
equal, this transport should be preferred to the default grpc-websockets transport, and in turn the fetch based
transport is usually superior to this.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
End the stream, both notifying the server that no more messages will be sent nor received, and preventing the client from receiving any more events.void
"Half close" the stream, signaling to the server that no more messages will be sent, but that the client is still open to receiving messages.void
sendMessage
(elemental2.core.Uint8Array msgBytes) Sends a message to the server.void
start
(jsinterop.base.JsPropertyMap<HeaderValueUnion> metadata) Starts the stream, sending metadata to the server.
-
Field Details
-
MULTIPLEX_PROTOCOL
- See Also:
-
SOCKET_PER_STREAM_PROTOCOL
- See Also:
-
-
Constructor Details
-
MultiplexedWebsocketTransport
-
-
Method Details
-
start
Description copied from interface:GrpcTransport
Starts the stream, sending metadata to the server.- Specified by:
start
in interfaceGrpcTransport
- Parameters:
metadata
- the headers to send the server when opening the connection
-
sendMessage
public void sendMessage(elemental2.core.Uint8Array msgBytes) Description copied from interface:GrpcTransport
Sends a message to the server.- Specified by:
sendMessage
in interfaceGrpcTransport
- Parameters:
msgBytes
- bytes to send to the server
-
finishSend
public void finishSend()Description copied from interface:GrpcTransport
"Half close" the stream, signaling to the server that no more messages will be sent, but that the client is still open to receiving messages.- Specified by:
finishSend
in interfaceGrpcTransport
-
cancel
public void cancel()Description copied from interface:GrpcTransport
End the stream, both notifying the server that no more messages will be sent nor received, and preventing the client from receiving any more events.- Specified by:
cancel
in interfaceGrpcTransport
-