Skip to content

Update ClockHub.cs - Clarify the method's purpose #35706

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

Merged
merged 1 commit into from
Jul 7, 2025

Conversation

MA-Maddin
Copy link
Contributor

This change is intended to make it clearer that the ClockHub's method is called (used) only by clients.

I was going through the "Host ASP.NET Core SignalR in background services" tutorial, but then wondered why SendTimeToClients() isn't called anywhere.
I first thought that this method is used by the server to send the current time to clients, but that's actually done by _clockHubContext.Clients.All.ShowTime(DateTime.Now);

Furthermore, it makes no sense that a(ny) client sends a time to all clients.

The tutorial would even work without this method, so ClockHub could be empty and everything runs as intended.

Make it clear that this method is called by clients only
@guardrex guardrex requested a review from wadepickett July 4, 2025 19:02
@wadepickett
Copy link
Contributor

Thanks for adding some clarity to the method name. That is better. Much appreciated @MA-Maddin!

@wadepickett wadepickett self-assigned this Jul 7, 2025
@wadepickett wadepickett merged commit ca1cc62 into dotnet:main Jul 7, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants