New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#609) Introducing async health checks #1077

Merged
merged 2 commits into from Feb 24, 2017

Conversation

Projects
None yet
2 participants
@arkigabor
Contributor

arkigabor commented Feb 18, 2017

A backward compatible solution for asynchronous health checks (#609). HealthCheck implementations can be marked with the Async annotation while providing:

  • execution period (mandatory)
  • scheduling type (fixed rate or fixed delay)
  • initial delay before first execution
  • unit of period and delay
  • initial health state until the first result is available

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.

@arteam arteam merged commit 51ab8d7 into dropwizard:3.2-development Feb 24, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@arteam

This comment has been minimized.

Show comment
Hide comment
@arteam

arteam Feb 24, 2017

Member

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 HealthCheckRegistry with async executors. Let me play a little bit with it, maybe I will add a follow-up a PR.

Member

arteam commented Feb 24, 2017

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 HealthCheckRegistry with async executors. Let me play a little bit with it, maybe I will add a follow-up a PR.

@arteam arteam added this to the 3.2.0 milestone Feb 24, 2017

@arteam arteam added the feature label Feb 24, 2017

This was referenced Feb 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment