dotnet / dotnet/AspNetCore.Docs
How to deal with concurrency when using SignalR?
- Dominant language
- C#
- Stars
- 13.1k
- Forks
- 24.6k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 97
Description
**Help us make content visible**
- Tell us what search terms you used and how you searched docs.
- I've made searches for `concurrency` and `signalr` terms
- Tell us what docs you found that didn't address your concern.
- I just found vague answers on Stack Overflow and this (good) issue: https://github.com/SignalR/SignalR/issues/4136
**Describe the new topic**
- Explain why this topic is needed.
- Writing a SignalR application that mutates a shared state (image a game instance with 5 concurrent players) in a multi-thread environment like dotnet, things can become inconsistent, besides other concurrency issues;
- Suggest a location in the Table of Contents.
- I think this topic deserves a separate page bellow [SignalR root tree](https://learn.microsoft.com/en-us/aspnet/core/signalr/introduction?view=aspnetcore-7.0)
- Write an abstract. In one **short** paragraph, describe what this topic will cover.
- In nodejs, JavaScript works with single thread + event loop, so is way easier to deal with concurrency when updating objects (you don't need to!). In dotnet, we can make use of Concurrent Data Structures and other C# language level constructs (is there something like Agents and Atoms in Clojure?) to achieve the same guaranties!
- Create an outline for the new topic. We'll help review the outline and approve it before anyone writes a topic.
- Sorry, but I'll need more time to figure it out, because I still don't know the answer!
***EDIT by @Rick-Anderson to add the following meta-data:***
---
#### Document Details
⚠ *Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.*
* ID: 1387f556-b4b7-70f9-5bd0-f0bccc597689
* Version Independent ID: fb016cdc-d281-6b5b-7466-2c718e7274b4
* Content: [Use hubs in ASP.NET Core SignalR](https://learn.microsoft.com/en-us/aspnet/core/signalr/hubs?view=aspnetcore-7.0)
* Content Source: [aspnetcore/signalr/hubs.md](https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/signalr/hubs.md)
* Product: **aspnet-core**
* Technology: **aspnetcore-signalr**
* GitHub Login: @bradygaster
* Microsoft Alias: **bradyg**
Contributor guide
Assessment
This issue has not been assessed yet.