OrleansContrib / SignalR.Orleans

SignalR backend based on Orleans.
MIT License
295 stars 64 forks source link

Adds HubUtility to resolve hub names. #130

Closed JRWinter1 closed 1 year ago

JRWinter1 commented 2 years ago

Keeps HubContext name resolution consistent with OrleansHubLifetimeManager.

I understand this could be breaking to some consumers of the library. However, I thought Id' raise the PR to get the conversation going.

In my opinion, the OrleansHubLifetimeManager should not look for the typed client of the hub when resolving the hub name but maybe I am missing something.

I've also brought the HubContext in line with the actual implementation of hub context which will ensure consistency between the HubContext and OrleansHubLifetimeManager.

From MSDN: public interface IHubContext<out THub> where THub : Hub Ref: https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.signalr.ihubcontext-1?view=aspnetcore-6.0

JRWinter1 commented 2 years ago

It would be nice to support strongly typed HubContext too:

public interface IHubContext<THub,T> where THub : Hub<T> where T : class

But that is a separate piece of work and slightly more involved so I will try to pick up in the near future.

galvesribeiro commented 1 year ago

Thanks @JRWinter1. Makes total sense. Since this is an internal thing, it should not be a breaking change as nobody should be relying on it. Nonetheless, I'll merge it as part of the v7.

Thanks!