public class Reactor extends Object
Modifier and Type | Method and Description |
---|---|
static <T,C extends Iterable<T>> |
toFlux(Supplier<CompletableFuture<C>> input)
Helper method to wrap an async call into a reactive one and translate
exceptions appropriately.
|
static <T> Mono<T> |
toMono(Supplier<CompletableFuture<T>> input)
Helper method to wrap an async call into a reactive one and translate
exceptions appropriately.
|
static <T> Mono<T> |
wrap(Request<?> request,
CompletableFuture<T> response,
boolean propagateCancellation)
|
public static <T> Mono<T> wrap(Request<?> request, CompletableFuture<T> response, boolean propagateCancellation)
request
- the request to wrap.response
- the full response to wrap, might not be the same as in the request.propagateCancellation
- if a cancelled/unsubscribed mono should also cancel the
request.public static <T> Mono<T> toMono(Supplier<CompletableFuture<T>> input)
input
- a supplier that will be called on every subscription.public static <T,C extends Iterable<T>> Flux<T> toFlux(Supplier<CompletableFuture<C>> input)
input
- a supplier that will be called on every subscription.Copyright © 2020 Couchbase, Inc.. All rights reserved.