pieperu
pieperu

Reputation: 2762

Continuous broadcasting with SignalR

I am currently broadcasting live scores for sports evens to the browser. This is currently achieved by running a continuous console application (Azure WebJob) to pick up data and broadcast it out.

The current solution is quite simple. 2 threads. 1 retrieves from a database and adds to a shared collection (shared between the threads) and the other thread picks up from the shared collection and broadcasts to subscribers, at a much more frequent rate than the data is retrieved, hence the 2 threads.

Is this the best way to do (continuous broadcast job) this or are there other techniques that can be implemented to achieve such a solution?

Upvotes: 1

Views: 106

Answers (1)

Shannon Holsinger
Shannon Holsinger

Reputation: 2341

Only thing I can think of is to switch the broadcast thread from continuous loop to an event-based action based on a trigger fired from a new score becoming available. There is no need to broadcast a duplicate score, so you fire an event when the user logs in to get the current score, then fire an update event when a new/different score is available.

Upvotes: 2

Related Questions