public interface HealthCheckService
HealthCheckService
performs various HealthCheck
s and returns
the result of each check wrapped by the Health
object.Modifier and Type | Method and Description |
---|---|
CompletableFuture<Health> |
performAsyncHealthCheck(Context context,
java.util.function.Consumer<HealthCheck> onStartConsumer,
java.util.function.Consumer<Response> onFinishConsumer)
Performs various
HealthCheck s asynchronously and returns a CompletableFuture which
contains the Health representing each HealthCheck s Response . |
CompletableFuture<Health> performAsyncHealthCheck(Context context, java.util.function.Consumer<HealthCheck> onStartConsumer, java.util.function.Consumer<Response> onFinishConsumer)
HealthCheck
s asynchronously and returns a CompletableFuture
which
contains the Health
representing each HealthCheck
s Response
.
It is up to the implementator to respect timeouts and handle exceptions accordingly, when
these situations arise when calling HealthCheck.perform(Context)
.
Callback methods can be provided to print information before and after a HealthCheck
is invoked.
When providing a onFinishConsumer
please note, that this is
invoked even if the HealthCheck.perform(Context)
execution failed or timed out and therefore may not
represent the value when calling HealthCheck.perform(Context)
directly.context
- The context objectonStartConsumer
- Callback method which is invoked before the HealthCheck.perform(Context)
method is invoked. May be null.onFinishConsumer
- Callback method which is invoked after the HealthCheck.perform(Context)
method is invoked. May be null.CompletableFuture
to retrieve the Health
from.Copyright © 2020. All rights reserved.