Client1
and Client2
. I want to call each in a Mono.zip
so that they can be done concurrently
zip
method arguments
public Mono<Tuple2<String, String>> getPair() {
return Mono.zip(
client1.getFirstPart(),
client2.getFirstPart());
}
function doSomething(item, callback) {
if (itemIsGood(item)) {
callback(convertItem, null);
} else {
callback(null, new Error("something is wrong with the item"));
}
}
.map
will handle the error and propagate it downstream, it is an "exceptional" case, hence side-effect.RuntimeException
).sink.success()
(or sink.complete()
if Flux) instead of passing an error and handling it later in the same operator (in the catch block) to use less operators
question about 'request' method
final Flux<Boolean> randoms = Flux.generate(sink -> sink.next(true));
randoms.filter(x -> x == true).subscribe(x ->System.out.println(x));
as I know , for the above code , LambdaSubscriber will request data from FilterFuseableSubscriber , just like downstream(LambdaSubscriber) request data from upstream(FilterFuseableSubscriber) , and for FilterFuseableSubscriber it will request data from upstream, my question is :
@Override
public void request(long n) {
s.request(n);
}
why the request number is the same as the downstream, if downstream request data number is 5 , for filter function , the requestion should more than 5 , since that it will filter some data , so can somebody tell me the logic :)
.onErrorResume
then ?
requestOnSeparateThread
flag when we have separate schedulers for blocking and non-blocking reactor calls. I have used requestOnSeparateThread
in my application but couldn't see any difference on setting requestOnSeparateThread = true/false