#java#reactor#flux#merge#
合并
视频讲解: https://www.bilibili.com/video/av81746042/
FluxMonoTestCase.java
package com.example.reactor;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Flux;
import java.time.Duration;
@Slf4j
public class FluxMonoTestCase extends BaseTestCase {
@Test
public void merge() throws InterruptedException {
Flux<Long> longFlux = Flux.interval(Duration.ofMillis(100)).take(10);
Flux<Long> longFlux2 = Flux.interval(Duration.ofMillis(100)).take(10);
Flux<Long> longFlux3 = Flux.merge(longFlux,longFlux2);
longFlux3.subscribe(val ->log.info("->{}",val));
Th