ElHaix
ElHaix

Reputation: 13006

Is it better to use multiple SignalR Hubs or setup a strategy pattern

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?

Upvotes: 1

Views: 414

Answers (1)

GaryMcAllister
GaryMcAllister

Reputation: 141

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).

Upvotes: 1

Related Questions