SignalR 和反应式组合 [英] SignalR and Reactive combo

查看:55
本文介绍了SignalR 和反应式组合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了这个关于如何让 SignalR 和 Rx 很好地播放的小宝石:

I found this little gem about how to get SignalR and Rx to play nicely:

Rx 和反应式教程

然而,您可能已经注意到,这仅在从服务器 -> 客户端运行时才有效.有谁知道如何走另一条路?我希望我的框架更像 NServiceBus 那样基于消息",而更少 RPC(信号器标准示例往往是这样).

However as you might have noticed this only works when going from server -> client. Does anyone know how to go the other way around? I want my framework to be a bit more "message" based like NServiceBus and less RPC (which signalr standard examples tend to be).

这是因为弱类型世界不太适合 RPC.在服务器端,我希望能够在客户端调用周围放置接口,但我不能,因为客户端甚至可能不是 OO 并且没有契约和接口的概念.

The reason for this is the weakly typed world doesn't lend itself very well to RPC. On the server side I'd love to be able to put interfaces around the client calls, but I can't because the client may not even be OO and has no concept of contracts and interfaces.

所以我希望把一切都变成基于消息的,中间有代理通过反应式 SOA 服务.希望 Reactive 和 DTO 将是我代码中唯一的依赖项.

So I'm hoping to turn everything into message based, with brokers in the middle via reactive, SOA services. Hopefully Reactive and DTOs will be the only dependencies in my code.

那么有谁知道这是如何实现的?

So does anyone know how this can be achieved?

推荐答案

很高兴您发现这篇文章很有价值.这只是一个如何推送到浏览器客户端的示例,但 SignalR 可以与任意数量的端点一起使用,包括使用 OWIN 的 Windows 服务.事实上,SignalR 的横向扩展解决方案已经与 Azure 服务总线集成,因此您的想法并不遥远.您可能想查看 Clemens Vasters 发帖谈论 Azure 服务总线实现以获取更多信息.

I'm glad you found the article valuable. It was just an example of how to push to browser clients, but SignalR will work with any number of end-points, including windows services using OWIN. In fact, the scale out solution for SignalR already integrates with the Azure service bus, so you're idea isn't that far off. You might want to check out Clemens Vasters post talking about the Azure service bus implementation for more information.

这篇关于SignalR 和反应式组合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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