Reactor系列(十二)window嵌套

#java#reactor#flux#window#

Flux嵌套

视频解说: https://www.bilibili.com/video/av80458406/

Reactor系列(十二)window嵌套

FluxMonoTestCase.java
package com.example.reactor;

import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Flux;

@Slf4j
public class FluxMonoTestCase extends BaseTestCase {
    @Test
    public void window(){
        //一维Flux
        Flux<String> stringFlux1 = Flux.just("a","b","c","d","e","f","g","h","i");
        //二维Flux
        Flux<Flux<String>> stringFlux2 = stringFlux1.window(2);
        stringFlux2.count().subscribe(System.out::println);
        //三维Flux
        Flux<Flux<Flux<String>>> stringFlux3 = stringFlux2.window(3);
        stringFlux3.count().subscribe(System.out::println);
    }
}

关注公众号,坚持每天3分钟视频学习

Reactor系列(十二)window嵌套

上一篇:react redux


下一篇:linux基础命令--groupmod 修改组定义