// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.Extensions.Diagnostics.HealthChecks
{
///
/// Represents a health check, which can be used to check the status of a component in the application, such as a backend service, database or some internal
/// state.
///
public interface IHealthCheck
{
///
/// Gets the name of the health check, which should indicate the component being checked.
///
string Name { get; }
///
/// Runs the health check, returning the status of the component being checked.
///
/// A that can be used to cancel the health check.
/// A that completes when the health check has finished, yielding the status of the component being checked.
Task CheckHealthAsync(CancellationToken cancellationToken = default);
}
}