public static void main(String[] args) throws Exception{
Flux.range(1, 40).window(20).subscribe(f -> f.subscribe(System.out::print));
System.out.println("############");
Flux.range(1, 4).windowUntil(i -> i % 2 == 0).subscribe(System.out::println);
System.out.println("############");
Flux.range(1, 4).windowWhile(i -> i % 2 == 0).subscribe(System.out::println);
System.out.println("############");
Stream<Flux<Long>> fluxStream = Flux.interval(Duration.ofSeconds(1))
.window(Duration.ofSeconds(4))
.take(2)
.toStream();
fluxStream.forEach(x -> x.toStream().forEach(System.out::print));
System.out.println("############");
Flux.interval(Duration.ofSeconds(1)).window(20).subscribe(f -> f.subscribe
Reactor3 源码解析十九: FluxWindow源码剖析
最新推荐文章于 2024-06-22 21:29:24 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)