© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
5 replies
reinaldyrfl

✅ Passing realtime data from Worker to ASP.NET Web API

I'm working on a stock broker company, currently working for the stock chart infrastructure. I need to connect to the realtime data feed server via a single TCP socket (the server's using C++), and fan out the stocks data in realtime via WebSocket to the frontend client (which is just static HTML/JS also statically served by ASP.NET Core).

One thing that bugs me and the team is: how do we properly transfer the data from the Worker instance to the Web API instance, so that it can be properly being fan out? At first I was thinking of using
System.Threading.Channels
System.Threading.Channels
, but having it as a singleton that used by both the Web API and Worker doesn't makes sense to me, as I suppose the class will be created twice on the Web API and on Worker (or did I got it wrong?).

I don't want to add another external infrastructure like using Kafka, Rabbit, or Redis pubsub, I want to avoid more latency.

So the questions would be:
1. How do I properly transfer (and possibly fan out) the data being consumed by Worker instance to the ASP.NET Core instance?
2. Is using
System.Threading.Channels
System.Threading.Channels
the best way to achieve this? On other language, I'd use
channel
channel
in Go and
std::sync::mpsc
std::sync::mpsc
in Rust.
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

✅ ASP.Net Core Web API
C#CC# / help
6mo ago
✅ asp.net web api connection refused
C#CC# / help
2y ago
✅ ASP.NET Core Web Api + SignalR
C#CC# / help
2y ago
✅ Authorization in ASP.NET Web Api
C#CC# / help
2y ago