Move GetAllByUserId to IOnlineClientManager instead of implementing as a static extension
See original GitHub issueThe default implementation of IOnlineClientManager
use a ConcurrentDictionary<string, IOnlineClient>
to store the relations between userId and connectionId.
It has problem when sites are deploy to two or more servers, or just one server but enable webgarden in iis (has multi process).
So, I wrote a RedisOnlineClientManager
to replace OnlineClientManager
, but found it may cause performance problem when someone call GetAllByUserId
in OnlineClientManagerExtensions
through GetAllClients
.
Above all, I think It’s a better practice to define GetAllByUserId
in IOnlineClientManager
, and leave the how-to-query to the real store mechanism (not a ConcurrentDictionary).
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Convert Static to Extension Method refactoring | ReSharper ...
Press Ctrl Shift 0R and then choose Convert Static Method to Extension. Right-click and choose Refactor | Convert Static Method to Extension ......
Read more >Using middleware config from extension methods in ASP. ...
In general, this won't work with extension methods. Extension methods are static and as such can only access other static members. ASP.
Read more >Extension Methods - C# Programming Guide
The static class Extensions contains extension methods defined for any type that implements IMyInterface . Classes A , B , and C all...
Read more >Extension methods
Overview; Using extension methods. Static types and dynamic; API conflicts. Implementing extension methods. Unnamed extensions.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gunpal5 https://github.com/personball/abplus/blob/master/src/Abplus.Web.SignalR/RealTime/RedisOnlineClientManager.cs
@personball I think I see the issue with using the Cache. It’s the sliding expiration policy cache that may get in the way. I think your implementation is much better than what I was working towards. Never mind on my question above.