-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Trim Async suffix on SignalR Hub method names #7554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks @halter73. @bradygaster FYI. |
Should we do this in SignalR? I don't think it makes the same kind of sense here, since SignalR is RPC, but MVC is a URL pattern. In MVC, it makes a lot of sense, because you may have an action like: public class CustomersController
{
public async Task GetAllAsync()
{
}
} And you want to access it at However, in SignalR you are calling a method, rather than sending a request to a URL. So if you have a Hub method: public class CustomersHub
{
public async Task GetAllAsync()
{
}
} The code you want to write on the .NET client would definitely be: var customers = /* Get Hub Connection */;
// Assume we had perfect client generation, etc.
var customers = await customers.GetAllAsync(); Stripping I realize it's not a perfect analogy, since JavaScript, Java and C++ are all viable clients and don't have this pattern. However, in this case, I think we should not be stripping suffixes from method names since the user is defining a method which will be called like a method rather than defining a method that ends up generating a URL pattern. |
Good point @anurse about RPC. The real benefit of this change seems to be related to the default way MVC does routing based on action names. |
If we were to do this at all, the Async suffix probably should be optional, but I'd rather keep things simple and have one true name for every hub method. |
Triage Decision: This doesn't make sense for SignalR, let's close. |
See #7420
@muratg We'll probably want to do this sooner than later since it's breaking.
The text was updated successfully, but these errors were encountered: