SignalR Hub Example Update to 7 plus add Hub Client Results#138
SignalR Hub Example Update to 7 plus add Hub Client Results#138wadepickett wants to merge 4 commits into
Conversation
|
Could you help me with the 3 Client Results hub classes for our standard hubs SingalRChat sample? The 3 Client Results hub samples are here in this PR:
Sorry to ask, I have been trying to work out the intent of how client results work but I'm not up to speed enough on SignalR to pull it off. |
| // <snippet_HubClientResultsStronglyTyped> | ||
| public interface IClient | ||
| { | ||
| Task<string> GetMessage(); |
There was a problem hiding this comment.
I think this needs to take a CancellationToken parameter.
| // <snippet_HubClientReturnContext> | ||
| public class ChatHubClientResultsContext : Hub | ||
| { | ||
| async Task SomeMethod(IHubContext<ChatHubClientResultsContext> context) |
There was a problem hiding this comment.
This is an odd way to use IHubContext. It's probably better from a controller or minimal api:
https://learn.microsoft.com/aspnet/core/signalr/hubcontext?view=aspnetcore-7.0#inject-an-instance-of-ihubcontext-in-a-controller
| .withUrl("/chat") | ||
| .build(); | ||
|
|
||
| connection.on("ReceiveMessage", (user, message) => { |
There was a problem hiding this comment.
If the intent is to have a runnable app, we'll need to add javascript code for the client results
https://learn.microsoft.com/aspnet/core/signalr/hubs?view=aspnetcore-7.0#typescript-client
There was a problem hiding this comment.
@BrennanConroy, sorry, I should have been more clear. I just took your code that was inline from the doc. I was hoping you could create runnable versions of them so we have one runnable sample somewhere. I do not have enough experience with SignalR to make your original samples work. Sorry for the confusion.
|
closing and reopening to run checks again |
|
@wadepickett can you update this for .NET 9? |
Make that .NET 10? |

------ Collaborative Work In Progress while in draft ------
Contributes to
Changes from existing 6.x version: