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 classstatic class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()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.voidsendMessage(elemental2.core.Uint8Array msgBytes) Sends a message to the server.voidstart(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:GrpcTransportStarts the stream, sending metadata to the server.- Specified by:
startin 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:GrpcTransportSends a message to the server.- Specified by:
sendMessagein 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:
finishSendin interfaceGrpcTransport
-
cancel
public void cancel()Description copied from interface:GrpcTransportEnd 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:
cancelin interfaceGrpcTransport
-