// 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 publisher of information.
///
///
///
/// The default health checks implementation provided an IHostedService implementation that can
/// be used to execute health checks at regular intervals and provide the resulting
/// data to all registered instances.
///
///
/// To provide an implementation, register an instance or type as a singleton
/// service in the dependency injection container.
///
///
/// instances are provided with a after executing
/// health checks in a background thread. The use of depend on hosting in
/// an application using IWebHost or generic host (IHost). Execution of
/// instance is not related to execution of health checks via a middleware.
///
///
public interface IHealthCheckPublisher
{
///
/// Publishes the provided .
///
/// The . The result of executing a set of health checks.
/// The .
/// A which will complete when publishing is complete.
Task PublishAsync(HealthReport report, CancellationToken cancellationToken);
}
}