Class Health.HealthClient
Client for Health
Inherited Members
Namespace: Grpc.Health.V1
Assembly: Grpc.HealthCheck.dll
Syntax
public class HealthClient : ClientBase<Health.HealthClient>
Constructors
HealthClient()
Protected parameterless constructor to allow creation of test doubles.
Declaration
protected HealthClient()
HealthClient(CallInvoker)
Creates a new client for Health that uses a custom CallInvoker
.
Declaration
public HealthClient(CallInvoker callInvoker)
Parameters
Type | Name | Description |
---|---|---|
CallInvoker | callInvoker | The callInvoker to use to make remote calls. |
HealthClient(ChannelBase)
Creates a new client for Health
Declaration
public HealthClient(ChannelBase channel)
Parameters
Type | Name | Description |
---|---|---|
ChannelBase | channel | The channel to use to make remote calls. |
HealthClient(ClientBase.ClientBaseConfiguration)
Protected constructor to allow creation of configured clients.
Declaration
protected HealthClient(ClientBase.ClientBaseConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
ClientBase.ClientBaseConfiguration | configuration | The client configuration. |
Methods
Check(HealthCheckRequest, CallOptions)
If the requested service is unknown, the call will fail with status NOT_FOUND.
Declaration
public virtual HealthCheckResponse Check(HealthCheckRequest request, CallOptions options)
Parameters
Type | Name | Description |
---|---|---|
HealthCheckRequest | request | The request to send to the server. |
CallOptions | options | The options for the call. |
Returns
Type | Description |
---|---|
HealthCheckResponse | The response received from the server. |
Check(HealthCheckRequest, Metadata, Nullable<DateTime>, CancellationToken)
If the requested service is unknown, the call will fail with status NOT_FOUND.
Declaration
public virtual HealthCheckResponse Check(HealthCheckRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
HealthCheckRequest | request | The request to send to the server. |
Metadata | headers | The initial metadata to send with the call. This parameter is optional. |
System.Nullable<System.DateTime> | deadline | An optional deadline for the call. The call will be cancelled if deadline is hit. |
System.Threading.CancellationToken | cancellationToken | An optional token for canceling the call. |
Returns
Type | Description |
---|---|
HealthCheckResponse | The response received from the server. |
CheckAsync(HealthCheckRequest, CallOptions)
If the requested service is unknown, the call will fail with status NOT_FOUND.
Declaration
public virtual AsyncUnaryCall<HealthCheckResponse> CheckAsync(HealthCheckRequest request, CallOptions options)
Parameters
Type | Name | Description |
---|---|---|
HealthCheckRequest | request | The request to send to the server. |
CallOptions | options | The options for the call. |
Returns
Type | Description |
---|---|
AsyncUnaryCall<HealthCheckResponse> | The call object. |
CheckAsync(HealthCheckRequest, Metadata, Nullable<DateTime>, CancellationToken)
If the requested service is unknown, the call will fail with status NOT_FOUND.
Declaration
public virtual AsyncUnaryCall<HealthCheckResponse> CheckAsync(HealthCheckRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
HealthCheckRequest | request | The request to send to the server. |
Metadata | headers | The initial metadata to send with the call. This parameter is optional. |
System.Nullable<System.DateTime> | deadline | An optional deadline for the call. The call will be cancelled if deadline is hit. |
System.Threading.CancellationToken | cancellationToken | An optional token for canceling the call. |
Returns
Type | Description |
---|---|
AsyncUnaryCall<HealthCheckResponse> | The call object. |
NewInstance(ClientBase.ClientBaseConfiguration)
Creates a new instance of client from given ClientBaseConfiguration
.
Declaration
protected override Health.HealthClient NewInstance(ClientBase.ClientBaseConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
ClientBase.ClientBaseConfiguration | configuration |
Returns
Type | Description |
---|---|
Health.HealthClient |
Overrides
Watch(HealthCheckRequest, CallOptions)
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 AsyncServerStreamingCall<HealthCheckResponse> Watch(HealthCheckRequest request, CallOptions options)
Parameters
Type | Name | Description |
---|---|---|
HealthCheckRequest | request | The request to send to the server. |
CallOptions | options | The options for the call. |
Returns
Type | Description |
---|---|
AsyncServerStreamingCall<HealthCheckResponse> | The call object. |
Watch(HealthCheckRequest, Metadata, Nullable<DateTime>, CancellationToken)
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 AsyncServerStreamingCall<HealthCheckResponse> Watch(HealthCheckRequest request, Metadata headers = null, DateTime? deadline = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
HealthCheckRequest | request | The request to send to the server. |
Metadata | headers | The initial metadata to send with the call. This parameter is optional. |
System.Nullable<System.DateTime> | deadline | An optional deadline for the call. The call will be cancelled if deadline is hit. |
System.Threading.CancellationToken | cancellationToken | An optional token for canceling the call. |
Returns
Type | Description |
---|---|
AsyncServerStreamingCall<HealthCheckResponse> | The call object. |