简体   繁体   English

Signalr 动态添加集线器

[英]Signalr dynamically add hubs

I've already looked SignalR - adding hubs at runtime , and the accepted answer doesn't provide an actual sample of the solution.我已经看过SignalR - 在运行时添加集线器,并且接受的答案没有提供解决方案的实际示例。

I'm looking to scale an application, a chat application that leverages the power of signalr hubs.我希望扩展一个应用程序,一个利用信号器集线器功能的聊天应用程序。 Each hub is a chat room, and as users connect to my website, I'd like to dynamically add signalr hubs (so the application can scale).每个集线器都是一个聊天室,当用户连接到我的网站时,我想动态添加信号器集线器(以便应用程序可以扩展)。 Is this at all possible?这可能吗? - Or is a another approach to have one single hub that can route traffic to different segments of users (simulating different chat "rooms")? - 或者是另一种方法让一个单一的集线器可以将流量路由到不同的用户群(模拟不同的聊天“房间”)?

The only way I know for this is to use Groups from SignalR.我知道的唯一方法是使用 SignalR 中的组。 And if you want to scale it horizontal you could use a Redis.如果你想水平扩展它,你可以使用 Redis。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM