I am trying to create a simple ASP.NET 5 application with SignalR that should regularly send messages to clients (for example, implement a dashboard with the values passed from the server to the browser).
I studied some posts like http://arulselvan.net/realtime-dashboard-asp-net-signalr-angularjs-d3js/ or http://henriquat.re/server-integration/signalr/integrateWithSignalRHubs.html . They recommend using a timer in a class that implements IRegisteredObject from the System.Web.Hosting .
However, I seem to be unable to find the namespace in which IRegisteredObject lives in ASP.NET 5. System.Web no longer exists in ASP.NET 5. I could not find information about this on the Internet. What will replace it in ASP.NET 5?
UPDATE
I am trying to execute the following solution:
create a timer encapsulating service
register it in Startup.cs as a singleton service, for example
public class Ticker { Timer timer = new Timer(1000); public Ticker() { timer.Elapsed += Timer_Elapsed; timer.Start(); } private void Timer_Elapsed(object sender, ElapsedEventArgs e) {
In Startup.cs
public void ConfigureServices(IServiceCollection services) {
How about this approach?
Aunun source share