Package io.grpc.internal
Class FailingClientStream
java.lang.Object
io.grpc.internal.NoopClientStream
io.grpc.internal.FailingClientStream
- All Implemented Interfaces:
ClientStream,Stream
An implementation of
ClientStream that fails (by calling ClientStreamListener.closed(io.grpc.Status, io.grpc.internal.ClientStreamListener.RpcProgress, io.grpc.Metadata)) when started, and silently does nothing for the other operations.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Statusprivate final ClientStreamListener.RpcProgressprivate booleanprivate final ClientStreamTracer[]Fields inherited from class io.grpc.internal.NoopClientStream
INSTANCE -
Constructor Summary
ConstructorsConstructorDescriptionFailingClientStream(Status error, ClientStreamTracer[] tracers) Creates aFailingClientStreamthat would fail with the given error.FailingClientStream(Status error, ClientStreamListener.RpcProgress rpcProgress, ClientStreamTracer[] tracers) Creates aFailingClientStreamthat would fail with the given error. -
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.(package private) StatusgetError()voidstart(ClientStreamListener listener) Starts stream.Methods inherited from class io.grpc.internal.NoopClientStream
cancel, flush, getAttributes, halfClose, isReady, optimizeForDirectExecutor, request, setAuthority, setCompressor, setDeadline, setDecompressorRegistry, setFullStreamDecompression, setMaxInboundMessageSize, setMaxOutboundMessageSize, setMessageCompression, writeMessage
-
Field Details
-
started
private boolean started -
error
-
rpcProgress
-
tracers
-
-
Constructor Details
-
FailingClientStream
Creates aFailingClientStreamthat would fail with the given error. -
FailingClientStream
public FailingClientStream(Status error, ClientStreamListener.RpcProgress rpcProgress, ClientStreamTracer[] tracers) Creates aFailingClientStreamthat would fail with the given error.
-
-
Method Details
-
start
Description copied from interface:ClientStreamStarts stream. This method may only be called once. It is safe to do latent initialization of the stream up untilClientStream.start(io.grpc.internal.ClientStreamListener)is called.This method should not throw any exceptions.
- Specified by:
startin interfaceClientStream- Overrides:
startin classNoopClientStream- Parameters:
listener- non-nulllistener of stream events
-
getError
Status getError() -
appendTimeoutInsight
Description copied from interface:ClientStreamAppend 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.- Specified by:
appendTimeoutInsightin interfaceClientStream- Overrides:
appendTimeoutInsightin classNoopClientStream
-