dotnet-architecture / HealthChecks

Experimental Health Checks for building services, such as with ASP.NET Core
Other
453 stars 124 forks source link

HealthCheck class design #37

Open ycrumeyrolle opened 7 years ago

ycrumeyrolle commented 7 years ago

The HealthCheck class is not not DI friendly. The constructor has values parameters like the check name, and check behavior with the Func<CancelationToken, ValueTask<IHealthCheckResult>> check parameter (ouch....)

As the HealthCheck class is responsible of the caching behavior, it should be the principal way to implement IHealthCheck. Related to #23.

bradwilson commented 7 years ago

Caching behavior was extracted to a base class earlier today. https://github.com/aspnet/HealthChecks/blob/dev/src/Microsoft.Extensions.HealthChecks/CachedHealthCheck.cs