Class Health.HealthBase
Base class for server-side implementations of Health
Inherited Members
Namespace: Grpc.Health.V1
Assembly: Grpc.HealthCheck.dll
Syntax
[BindServiceMethod(typeof(Health), "BindService")]
public abstract class HealthBase
Methods
Check(HealthCheckRequest, ServerCallContext)
If the requested service is unknown, the call will fail with status NOT_FOUND.
Declaration
public virtual Task<HealthCheckResponse> Check(HealthCheckRequest request, ServerCallContext context)
Parameters
Type | Name | Description |
---|---|---|
HealthCheckRequest | request | The request received from the client. |
ServerCallContext | context | The context of the server-side call handler being invoked. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<HealthCheckResponse> | The response to send back to the client (wrapped by a task). |
Watch(HealthCheckRequest, IServerStreamWriter<HealthCheckResponse>, ServerCallContext)
Performs a watch for the serving status of the requested service. The server will immediately send back a message indicating the current serving status. It will then subsequently send a new message whenever the service's serving status changes.
If the requested service is unknown when the call is received, the server will send a message setting the serving status to SERVICE_UNKNOWN but will not terminate the call. If at some future point, the serving status of the service becomes known, the server will send a new message with the service's serving status.
If the call terminates with status UNIMPLEMENTED, then clients should assume this method is not supported and should not retry the call. If the call terminates with any other status (including OK), clients should retry the call with appropriate exponential backoff.
Declaration
public virtual Task Watch(HealthCheckRequest request, IServerStreamWriter<HealthCheckResponse> responseStream, ServerCallContext context)
Parameters
Type | Name | Description |
---|---|---|
HealthCheckRequest | request | The request received from the client. |
IServerStreamWriter<HealthCheckResponse> | responseStream | Used for sending responses back to the client. |
ServerCallContext | context | The context of the server-side call handler being invoked. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating completion of the handler. |