动态合并 Flux [英] Dynamically merging Fluxes

查看:69
本文介绍了动态合并 Flux的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个应用程序,服务器端应用了事件溯源模式,所有传入的命令都由 Reactor 按顺序处理.我从客户端连接获取这些命令.唉,我的 Netty 管道在不尊重反应式合约的情况下发布命令.Reactor Netty 可能是解决方案的一部分,因为它将响应式合约强制执行到 Netty 管道.

I've written an application with the server side applying the Event Sourcing pattern, with all incoming commands processed sequentially with the Reactor. I get those commands from client connexions. Alas, my Netty Pipeline publishes commands with no respect for the Reactive Contract. Reactor Netty could be a part of a solution, because it enforces the Reactive Contract down to the Netty Pipeline.

但是对于 Reactor Netty,每个连接都是一个 Flux.添加和删​​除连接.

But with Reactor Netty, each connection in a Flux. Connections are added and removed.

如何将多个 Flux 动态合并为一个?如何通过传入的 Flux 进行循环?

How do I merge dynamically several Flux in one? How to round-robin through incoming Fluxes?

推荐答案

我不太确定我是否正确理解您的问题,如果您需要一个以异步方式生成事件的事件流,您可以尝试使用reactor.core.publisher.TopicProcessor.使用 TopicProcessor,我们创建了一个堆栈,其事件来自多个不同的来源,我们可以将其作为一个反应流进行处理.

I'm not quite sure if I understood your questions correctly, if you need an event stream whose events are generated in an async way, you can try to use reactor.core.publisher.TopicProcessor. With TopicProcessor, we created a stack whose event came from several different sources and we can process it as one reactive stream.

我对reactor-netty也很陌生,但是网上的资源很少,所以我想提供一下我的拙见,供大家参考.

I'm also quite new at reactor-netty, but there are very few resources available on the internet, so I would like to provide my humble opinion for your reference.

这篇关于动态合并 Flux的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆