From my understanding of the SignalR documentation, you can have 1..* hubs, but only one pipe is created b/t client/server.

I assume multiple hubs is good for organization, so which is best - multiple hubs, or setup a strategy pattern with your main hub connection class that manages tasks (OnConnected, OnReconnected, OnDisconnected...), then create multiple strategy classes to isolate functionality?

有帮助吗?

解决方案

I see it difficult to use a strategy based approach as you need to call dynamic client methods to return data.

This would mean passing reference to the dynamic hub base object which defects the object of hubs.

Essentially the hub is already a strategy on top of the bus context (in pattern terms).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top