our application is divided in several layers, the most important are:
- Data Layer
- Business Layer
- Presentation Layer (ASP.NET MVC 5)
The Business Layer must live broadcast some information to the connected clients via SignalR (Presentation Layer). What is the best practice for doing that?
Should the Business layer use OWIN to self host a SignalR Server? Or is it cleaner, if the presentation layer defines a webservice (which holds the signalr logic) that is called by Business Layer to push Information to presentation layer?
Are there any better ideas?
Thanks a lot Levi
I created a Event Aggregator (Service bus) proxy for SignalR, this way you can fire a event anywhere in your domain (Business, data etc) and it will be forwarded to your clients.
Install using nuget
Follow the wiki for the few steps needed for setting it up. https://github.com/AndersMalmgren/SignalR.EventAggregatorProxy/wiki
Once configured you can listen to events from javascript
demo project:
https://github.com/AndersMalmgren/SignalR.EventAggregatorProxy/tree/master/SignalR.EventAggregatorProxy.Demo.MVC4