title: ASP.net web app, push notification to browser by creating a service
body: <p><strong>Web application Asp.net &amp; C#</strong></p>
  
  <p>I am developing an web application that ideally would include a notification service, updates a user when they received an interest or a like on a browser.</p>
  
  <p><strong>Theory</strong></p>
  
  <p>For example user 1 clicks like for user 2, and user 2 information gets passed into my web application for processing. If I wanted to update user 2 when online/offline I need to have a process handle that asynchronously. When user 2 signs on, my application would have to check if there are any updates and push, and continue to check while the user is on. The way I see it is I would need to dedicate a task for each user that accesses my app to check if there are any updates for that user. If there aren't any updates, that task will be locked waiting for one. There will already be concurrent connections waiting for that task so that is 2x the consumption.</p>
  
  <p><strong>Issue</strong></p>
  
  <p>I am trying to figure out another approach to distribute that load so that my application can handle pushes gracefully by communicating with other systems or services. Since dedicating a worker task for each user with a concurrent connection would be too resource intense.</p>
  
  <p><strong>Researched so far</strong></p>
  
  <p>I looked into a message queuing system to see if that would solve the problem, but when researching it seems like I would be doing the same thing as dedicating a task to handle each user who access my application to listen to any messages coming from the queue.</p>
  
  <p>Or even worse I would have to create unique queues for each user which is not recommended and then process the message and add more logic to whether the user is online/offline.</p>
  
  <p><strong>Question</strong></p>
  
  <p>What is the most efficient way of checking for an update, is it the way I described above, dedicating a task for each user uses my web application, or is there another design pattern that can be used to service that part of my application?</p>
  
  <p><strong>Point I would like to make</strong></p>
  
  <p>I don't have an issue with connecting the client to my web application with frameworks like signalr, or methods like commet or long polling.</p>
  
  <p>I used signalR with SQLdependancy but there is issues with performance. I cant use SQL Server to trigger events because if the amount of users grow it locks up a thread on my server because each hub created with a dependency on SQL will call a asych/await. In theory I really want to replicate that as a service to my app, but am at a loss on figuring out how to that.</p>