Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a defined strategy for versioning SignalR hubs, so that old JS code can continue to work?

I want to be able to make changes to the method signatures, names, etc on existing SignalR hubs. Is there a defined strategy for versioning SignalR hubs, so that old JS code can continue to work, without having to create a fresh newly named hub for the new calls?

like image 453
David Pfeffer Avatar asked Jul 22 '15 20:07

David Pfeffer


People also ask

What is hubName in SignalR?

SignalR Hubs are a way to logically group connections as documented. Take an example of a chat application. A group of users could be part of the same hub which allows for sending messages between users in the group. The hubName here can be any string which is used to scope messages being sent between clients.

What is hub proxy SignalR?

The SignalR Hubs API enables you to make remote procedure calls (RPCs) from a server to connected clients and from clients to the server. In server code, you define methods that can be called by clients, and you call methods that run on the client.

What is Hub in .NET core?

Hub is a Server side material and needs to be hosted. For . NET, we have 2 clients that is (jQuery client and have ASP.NET client). So from here we will check how we can work with signalR. Open vs and Create a new Web Project in Console Application.


1 Answers

I'd say the short answer is no. Signalr does not have any versioning strategy like that.

The question is a little light on details, but signalr has for instance the option to use an attribute on a class to define the hubname. You could also create a new hub class by deriving from the original Hub in order to help you reuse existing code. Whatever you do new clientside js will need to be written.

like image 92
Robbert Draaisma Avatar answered Oct 09 '22 16:10

Robbert Draaisma