Package io.grpc.internal
Class RetriableStream.Sublistener
java.lang.Object
io.grpc.internal.RetriableStream.Sublistener
- All Implemented Interfaces:
ClientStreamListener
,StreamListener
- Enclosing class:
RetriableStream<ReqT>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.grpc.internal.ClientStreamListener
ClientStreamListener.RpcProgress
Nested classes/interfaces inherited from interface io.grpc.internal.StreamListener
StreamListener.MessageProducer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
closed
(Status status, ClientStreamListener.RpcProgress rpcProgress, Metadata trailers) Called when the stream is fully closed.private Integer
getPushbackMills
(Metadata trailer) void
headersRead
(Metadata headers) Called upon receiving all header information from the remote end-point.private RetriableStream.HedgingPlan
makeHedgingDecision
(Status status, Metadata trailer) private RetriableStream.RetryPlan
makeRetryDecision
(Status status, Metadata trailer) Decides in current situation whether or not the RPC should retry and if it should retry how long the backoff should be.void
Called upon receiving a message from the remote end-point.void
onReady()
This indicates that the transport is now capable of sending additional messages without requiring excessive buffering internally.
-
Field Details
-
substream
-
-
Constructor Details
-
Sublistener
Sublistener(RetriableStream.Substream substream)
-
-
Method Details
-
headersRead
Description copied from interface:ClientStreamListener
Called upon receiving all header information from the remote end-point. Note that transports are not required to call this method if no header information is received, this would occur when a stream immediately terminates with an error and onlyClientStreamListener.closed(io.grpc.Status, RpcProgress, Metadata)
is called.This method should return quickly, as the same thread may be used to process other streams.
- Specified by:
headersRead
in interfaceClientStreamListener
- Parameters:
headers
- the fully buffered received headers.
-
closed
Description copied from interface:ClientStreamListener
Called when the stream is fully closed.Status.Code.OK
is the only status code that is guaranteed to have been sent from the remote server. Any other status code may have been caused by abnormal stream termination. This is guaranteed to always be the final call on a listener. No further callbacks will be issued.This method should return quickly, as the same thread may be used to process other streams.
- Specified by:
closed
in interfaceClientStreamListener
- Parameters:
status
- details about the remote closurerpcProgress
- RPC progress when client stream listener is closedtrailers
- trailing metadata
-
makeRetryDecision
Decides in current situation whether or not the RPC should retry and if it should retry how long the backoff should be. The decision does not take the commitment status into account, so caller should check it separately. It also updates the throttle. It does not change state. -
makeHedgingDecision
-
getPushbackMills
-
messagesAvailable
Description copied from interface:StreamListener
Called upon receiving a message from the remote end-point.Implementations must eventually drain the provided
producer
StreamListener.MessageProducer
completely by invokingStreamListener.MessageProducer.next()
to obtain deframed messages until the producer returns null.This method should return quickly, as the same thread may be used to process other streams.
- Specified by:
messagesAvailable
in interfaceStreamListener
- Parameters:
producer
- supplier of deframed messages.
-
onReady
public void onReady()Description copied from interface:StreamListener
This indicates that the transport is now capable of sending additional messages without requiring excessive buffering internally. This event is just a suggestion and the application is free to ignore it, however doing so may result in excessive buffering within the transport.- Specified by:
onReady
in interfaceStreamListener
-