Search code examples
c#.netredissignalrreal-time

How to push telemetry data to client via SignalR?


This is more of a design issue... I have a worker that collects real time data from several devices (temp. sensors) and I want to do several things when new data is collected:

  1. Push it to the client (AngularJS app) via SignalR
  2. Cache the new data so it can be accesed faster
  3. Store the data into the database
  4. etc... (maybe do some more stuff)

So how should I do this? (The worker and the SignalR are on the same machine.) I came up with some kind of an event engine/aggregator, but I don't think it is a valid solution. Could you give me some kind of guidance on how should I approach this problem? Maybe I should use Redis as event (pub/sub) server?


Solution

  • Here is a solution to a problem, similar to the one you explaned -> Building a SignalR / Knockout dashboard with guaranteed messaging

    I think that both the redis and the event aggregator solutions should do the job. I also suggest you use the signalr just for notification purposes. Then the client should request the new data... That way you can somewhat guarantee that the data will arrive... maybe not on time, but it will... eventually :)