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
Fields inherited from class io.grpc.internal.NoopClientStream
INSTANCE
-
Constructor Summary
ConstructorsConstructorDescriptionFailingClientStream
(Status error, ClientStreamTracer[] tracers) Creates aFailingClientStream
that would fail with the given error.FailingClientStream
(Status error, ClientStreamListener.RpcProgress rpcProgress, ClientStreamTracer[] tracers) Creates aFailingClientStream
that would fail with the given error. -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendTimeoutInsight
(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.void
start
(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
-
Constructor Details
-
FailingClientStream
Creates aFailingClientStream
that would fail with the given error. -
FailingClientStream
public FailingClientStream(Status error, ClientStreamListener.RpcProgress rpcProgress, ClientStreamTracer[] tracers) Creates aFailingClientStream
that would fail with the given error.
-
-
Method Details
-
start
Description copied from interface:ClientStream
Starts 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:
start
in interfaceClientStream
- Overrides:
start
in classNoopClientStream
- Parameters:
listener
- non-null
listener of stream events
-
appendTimeoutInsight
Description copied from interface:ClientStream
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.- Specified by:
appendTimeoutInsight
in interfaceClientStream
- Overrides:
appendTimeoutInsight
in classNoopClientStream
-