SignalR implementation for MVC 3
-
13-12-2019 - |
Question
I want to use SignalR in my mvc 3 project. I have ticket system like "basecamp" or "donedone", so when a new ticket assigned to any user in the system, these users should be notified. Old system should be working with jquery timer and in every 1 minute should check the database to see if there is a new ticket.
But as i read about SignalR, i can actually trigger something on server side which triggers client side. But i don't know if i can implement this on my app. For example, i have a business layer to do db operations. So can i trigger SignalR Hub when i create a new ticket. Are there examples for it?
Thanks.
Solution
I also blogged about implementing something similar to your requirements using SignalR. A call to a web service in my case triggers updating specific client browsers with updated statistics.
OTHER TIPS
Yes, this is indeed possible. Please take a look at the section titled "Broadcasting over a Hub from outside of a Hub" at https://github.com/SignalR/SignalR/wiki/Hubs