How to await when all Disposable elements will be finished?
问题 Lets consider following code: List<Mono<String>> monoList= apiCall(); List<Disposable> disposableList = monoList.stream() .map(m-> m.subscribe(str-> { log.info("Mono is finished with "+ str); }) ).collect(Collectors.toList()); // I need to await here I need to await when all mono will be finished. How could I achieve it? 回答1: Not mixing different streaming APIs you could utilize side effects instead of subscriptions and await completion with then() Mono<Void> await = Flux .fromIterable