use of com.couchbase.client.core.endpoint.http.CoreCommonOptions in project couchbase-jvm-clients by couchbase.
the class HealthPinger method pingHttpEndpoint.
private static Mono<EndpointPingReport> pingHttpEndpoint(final Core core, final RequestTarget target, final CoreCommonOptions options, final String path) {
return Mono.defer(() -> {
CoreHttpRequest request = core.httpClient(target).get(path(path), options).build();
core.send(request);
return Reactor.wrap(request, request.response(), true).map(response -> {
request.context().logicallyComplete();
return assembleSuccessReport(request.context(), response.channelId(), Optional.empty());
}).onErrorResume(throwable -> {
request.context().logicallyComplete();
return Mono.just(assembleFailureReport(throwable, request.context(), Optional.empty()));
});
});
}
Aggregations