What's the point of .switchIfEmpty() getting evaluated eagerly?
问题 Even if my stream is not empty, the fallback stream would always be created? What's the intent behind doing this? This is extremely non-idiomatic. On the other hand, . onErrorResume is evaluated lazily. Could someone please explain to me why . switchIsEmpty is evaluated eagerly? Here's the code: public static void main(String[] args) { Mono<Integer> m = Mono.just(1); m.flatMap(a -> Mono.delay(Duration.ofMillis(5000)).flatMap(p -> Mono.empty())) .switchIfEmpty(getFallback()) .doOnNext(a ->