Package com.couchbase.client.core.api.kv
Class CoreAsyncResponse<T>
java.lang.Object
com.couchbase.client.core.api.kv.CoreAsyncResponse<T>
Associates a
CompletableFuture
with a cancellation task.
Lets the Async API tell the Reactive API how to cancel a request in a protocol-agnostic way, so the default implementation of the Reactive API works with both Classic and Protostellar.
A CompletableFuture alone is not sufficient, because a completion stage does not propagate cancellation upstream. If the Async API methods were to return only a CompletableFuture, they could not reliably attach the cancellation logic required by the Reactive API methods (which by default are thin wrappers over the Async APIs).
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<U> CoreAsyncResponse<U>
flatMap
(Function<? super T, ? extends CoreAsyncResponse<U>> fn) <U> CoreAsyncResponse<U>
<U> CompletableFuture<U>
<U> CompletableFuture<U>
thenCompose
(Function<? super T, ? extends CompletableFuture<U>> fn) toFuture()
toMono()
-
Constructor Details
-
CoreAsyncResponse
-
-
Method Details
-
toBlocking
-
toFuture
-
toFutureVoid
-
toMono
-
thenApply
-
thenCompose
-
map
-
flatMap
-