Package io.grpc.internal
Class DelayedClientTransport.PendingStream
- java.lang.Object
-
- io.grpc.internal.DelayedStream
-
- io.grpc.internal.DelayedClientTransport.PendingStream
-
- All Implemented Interfaces:
ClientStream
,Stream
- Enclosing class:
- DelayedClientTransport
private class DelayedClientTransport.PendingStream extends DelayedStream
-
-
Field Summary
Fields Modifier and Type Field Description private LoadBalancer.PickSubchannelArgs
args
private Context
context
private ClientStreamTracer[]
tracers
-
Constructor Summary
Constructors Modifier Constructor Description private
PendingStream(LoadBalancer.PickSubchannelArgs args, ClientStreamTracer[] tracers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
cancel(Status reason)
Abnormally terminates the stream.private java.lang.Runnable
createRealStream(ClientTransport transport)
Runnable may be null.protected void
onEarlyCancellation(Status reason)
-
Methods inherited from class io.grpc.internal.DelayedStream
flush, getAttributes, getRealStream, halfClose, isReady, optimizeForDirectExecutor, request, setAuthority, setCompressor, setDeadline, setDecompressorRegistry, setFullStreamDecompression, setMaxInboundMessageSize, setMaxOutboundMessageSize, setMessageCompression, setStream, start, writeMessage
-
-
-
-
Field Detail
-
args
private final LoadBalancer.PickSubchannelArgs args
-
context
private final Context context
-
tracers
private final ClientStreamTracer[] tracers
-
-
Constructor Detail
-
PendingStream
private PendingStream(LoadBalancer.PickSubchannelArgs args, ClientStreamTracer[] tracers)
-
-
Method Detail
-
createRealStream
private java.lang.Runnable createRealStream(ClientTransport transport)
Runnable may be null.
-
cancel
public void cancel(Status reason)
Description copied from interface:ClientStream
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(io.grpc.Status, io.grpc.internal.ClientStreamListener.RpcProgress, io.grpc.Metadata)
is called. This method may only be called afterClientStream.start(io.grpc.internal.ClientStreamListener)
, but else is safe to be called at any time and multiple times and from any thread.- Specified by:
cancel
in interfaceClientStream
- Overrides:
cancel
in classDelayedStream
- Parameters:
reason
- must be non-OK
-
onEarlyCancellation
protected void onEarlyCancellation(Status reason)
- Overrides:
onEarlyCancellation
in classDelayedStream
-
appendTimeoutInsight
public void appendTimeoutInsight(InsightBuilder insight)
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 classDelayedStream
-
-