Package io.grpc.protobuf.services
Class HealthCheckingLoadBalancerFactory.HealthCheckState.HcStream
java.lang.Object
io.grpc.ClientCall.Listener<HealthCheckResponse>
io.grpc.protobuf.services.HealthCheckingLoadBalancerFactory.HealthCheckState.HcStream
- Enclosing class:
HealthCheckingLoadBalancerFactory.HealthCheckState
private class HealthCheckingLoadBalancerFactory.HealthCheckState.HcStream
extends ClientCall.Listener<HealthCheckResponse>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientCall<HealthCheckRequest, HealthCheckResponse> private booleanprivate final Stringprivate final com.google.common.base.Stopwatch -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void(package private) voidhandleResponse(HealthCheckResponse response) (package private) voidhandleStreamClosed(Status status) voidThe ClientCall has been closed.voidonMessage(HealthCheckResponse response) A response message has been received.(package private) voidstart()toString()Methods inherited from class io.grpc.ClientCall.Listener
onHeaders, onReady
-
Field Details
-
call
-
callServiceName
-
stopwatch
private final com.google.common.base.Stopwatch stopwatch -
callHasResponded
private boolean callHasResponded
-
-
Constructor Details
-
HcStream
HcStream()
-
-
Method Details
-
start
void start() -
cancel
-
onMessage
Description copied from class:ClientCall.ListenerA response message has been received. May be called zero or more times depending on whether the call response is empty, a single message or a stream of messages.- Overrides:
onMessagein classClientCall.Listener<HealthCheckResponse>- Parameters:
response- returned by the server
-
onClose
Description copied from class:ClientCall.ListenerThe ClientCall has been closed. Any additional calls to theClientCallwill not be processed by the server. No further receiving will occur and no further notifications will be made.Since
Metadatais not thread-safe, the caller must not access (read or write)trailersafter this point.If
statusreturns false forStatus.isOk(), then the call failed. An additional block of trailer metadata may be received at the end of the call from the server. An emptyMetadataobject is passed if no trailers are received.This method should not throw. If this method throws, there is no way to be notified of the exception. Implementations should therefore be careful of exceptions which can accidentally leak resources.
- Overrides:
onClosein classClientCall.Listener<HealthCheckResponse>- Parameters:
status- the result of the remote call.trailers- metadata provided at call completion.
-
handleResponse
-
handleStreamClosed
-
toString
-