© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
2 replies
Blue

How do you loosely couple SignalR service to the rest of application?

Lookin for some advice on how to loosely couple SignalR hub with rest of my application, maybe some sanity check?

Right now 2 things come to my mind:
1. Make a service encapsulating SignalR stuff and use its interface to expose in the rest of my application. This solves issue of bi-directional coupling since i can expose methods that talk to connections by connection Id and events that fire when connection sends something.
2. Use MediatR to facilitate bi-directional communication. This has the added benefit of tidying things up but has some drawbacks:
1. I can't find neat way to use Rx stuff to do things such as throttling
2. I now have bi-directional dependency on mediator and request handlers
3. Still didn't figure out a way to package IHub somewhere


Is there a third way? What do you guys think/do?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to hide the Console of a Worker Service application
C#CC# / help
2y ago
✅ SignalR in a background service
C#CC# / help
2y ago
Unable to connect to SignalR (Not Azure SignalR) after deployment to Azure App Service
C#CC# / help
2y ago
✅ [SignalR] How to effeciently keep track of ConnectionIds.
C#CC# / help
12mo ago