Show / Hide Table of Contents

    Class HealthServiceImpl

    Implementation of a simple Health service. Useful for health checking.

    Registering service with a server:

    var serviceImpl = new HealthServiceImpl();
    server = new Server();
    server.AddServiceDefinition(Grpc.Health.V1.Health.BindService(serviceImpl));
    Inheritance
    System.Object
    Health.HealthBase
    HealthServiceImpl
    Inherited Members
    Health.HealthBase.Watch(HealthCheckRequest, IServerStreamWriter<HealthCheckResponse>, ServerCallContext)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Grpc.HealthCheck
    Assembly: Grpc.HealthCheck.dll
    Syntax
    public class HealthServiceImpl : Health.HealthBase

    Methods

    Check(HealthCheckRequest, ServerCallContext)

    Performs a health status check.

    Declaration
    public override Task<HealthCheckResponse> Check(HealthCheckRequest request, ServerCallContext context)
    Parameters
    Type Name Description
    HealthCheckRequest request

    The check request.

    ServerCallContext context

    The call context.

    Returns
    Type Description
    System.Threading.Tasks.Task<HealthCheckResponse>

    The asynchronous response.

    Overrides
    Health.HealthBase.Check(HealthCheckRequest, ServerCallContext)

    ClearAll()

    Clears statuses for all services.

    Declaration
    public void ClearAll()

    ClearStatus(String)

    Clears health status for given service.

    Declaration
    public void ClearStatus(string service)
    Parameters
    Type Name Description
    System.String service

    The service. Cannot be null.

    SetStatus(String, HealthCheckResponse.Types.ServingStatus)

    Sets the health status for given service.

    Declaration
    public void SetStatus(string service, HealthCheckResponse.Types.ServingStatus status)
    Parameters
    Type Name Description
    System.String service

    The service. Cannot be null.

    HealthCheckResponse.Types.ServingStatus status

    the health status

    Back to top Generated by DocFX