Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

when to use multiple hubs in signalR?

am working on chat application, using signal R.

I was wondering about when to use multiple hubs in signal r, what are the advantages, to use multiple hubs, or to use single hub is good approach?

like image 497
bilal Avatar asked Dec 19 '22 12:12

bilal


1 Answers

Per https://www.asp.net/signalr/overview/guide-to-the-api/hubs-api-guide-server#multiplehubs

There is no performance difference for multiple Hubs compared to defining all Hub functionality in a single class.

Therefore, it is simply a matter of deciding if you want to use multiple hubs to organize your code/functionality. OOP principals certainly apply, but it's a logical decision you have to make.

like image 188
Alex Dresko Avatar answered Feb 15 '23 05:02

Alex Dresko