Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
(#609) Introducing async health checks #1077
A backward compatible solution for asynchronous health checks (#609). HealthCheck implementations can be marked with the Async annotation while providing:
Async checks can be registered the same way regular health checks. On registration the health check registry is wrapping the async health check with a decorator that caches the last result and schedules a periodic execution. This decorator object is put into the underlying map and when its check is invoked it simply returns a cached result. On unregistration the registry cancels the task. To preserve the asynchronous behavior elsewhere the listeners are notified with the async decorator instead of the original health check.
Generally looks good to me. Thanks for your contribution! This could be a very useful feature and using annotations makes it very easy for users to convert a health check to an async health check. My biggest concern is to how correctly shut down a