Interface ClientStream
- All Superinterfaces:
Stream
- All Known Implementing Classes:
AbstractClientStream, DelayedClientTransport.PendingStream, DelayedStream, FailingClientStream, ForwardingClientStream, InProcessTransport.InProcessStream.InProcessClientStream, NettyClientStream, NoopClientStream, RetriableStream
-
Method Summary
Modifier and TypeMethodDescriptionvoidappendTimeoutInsight(InsightBuilder insight) Append information that will be included in the locally generated DEADLINE_EXCEEDED errors to the givenInsightBuilder, in order to tell the user about the state of the stream so that they can better diagnose the cause of the error.voidAbnormally terminates the stream.Attributes that the stream holds at the current moment.voidCloses the local side of this stream and flushes any remaining messages.voidsetAuthority(String authority) Override the default authority withauthority.voidsetDeadline(Deadline deadline) Sets the effective deadline of the RPC.voidsetDecompressorRegistry(DecompressorRegistry decompressorRegistry) Sets the registry to find a decompressor for the framer.voidsetFullStreamDecompression(boolean fullStreamDecompression) Enables full-stream decompression, allowing the client stream to useGzipInflatingBufferto decode inbound GZIP compressed streams.voidsetMaxInboundMessageSize(int maxSize) Sets the max size accepted from the remote endpoint.voidsetMaxOutboundMessageSize(int maxSize) Sets the max size sent to the remote endpoint.voidstart(ClientStreamListener listener) Starts stream.Methods inherited from interface Stream
flush, isReady, optimizeForDirectExecutor, request, setCompressor, setMessageCompression, writeMessage
-
Method Details
-
cancel
Abnormally terminates the stream. After calling this method, no further messages will be sent or received, however it may still be possible to receive buffered messages for a brief period untilClientStreamListener.closed(Status, ClientStreamListener.RpcProgress, Metadata)is called. This method may only be called afterstart(ClientStreamListener), but else is safe to be called at any time and multiple times and from any thread.- Parameters:
reason- must be non-OK
-
halfClose
void halfClose()Closes the local side of this stream and flushes any remaining messages. After this is called, no further messages may be sent on this stream, but additional messages may be received until the remote end-point is closed. This method may only be called once, and only afterstart(ClientStreamListener). -
setAuthority
Override the default authority withauthority. May only be called beforestart(ClientStreamListener). -
setFullStreamDecompression
void setFullStreamDecompression(boolean fullStreamDecompression) Enables full-stream decompression, allowing the client stream to useGzipInflatingBufferto decode inbound GZIP compressed streams. -
setDecompressorRegistry
Sets the registry to find a decompressor for the framer. May only be called beforestart(ClientStreamListener). If the transport does not support compression, this may do nothing.- Parameters:
decompressorRegistry- the registry of decompressors for decoding responses
-
start
Starts stream. This method may only be called once. It is safe to do latent initialization of the stream up untilstart(ClientStreamListener)is called.This method should not throw any exceptions.
- Parameters:
listener- non-nulllistener of stream events
-
setMaxInboundMessageSize
void setMaxInboundMessageSize(int maxSize) Sets the max size accepted from the remote endpoint. -
setMaxOutboundMessageSize
void setMaxOutboundMessageSize(int maxSize) Sets the max size sent to the remote endpoint. -
setDeadline
-
getAttributes
Attributes getAttributes()Attributes that the stream holds at the current moment. Thread-safe and can be called at any time, although some attributes are there only after a certain point. -
appendTimeoutInsight
Append information that will be included in the locally generated DEADLINE_EXCEEDED errors to the givenInsightBuilder, in order to tell the user about the state of the stream so that they can better diagnose the cause of the error.
-