title: Replacement for IRegisteredObject in ASP.NET 5?
body: <p>I am trying to build a simple ASP.NET 5 app with SignalR which should push messages to clients at regular intervals (e.g. implement a dashboard with values pushed from the server to the browser.)</p>
  
  <p>I researched some posts such as <a href="http://arulselvan.net/realtime-dashboard-asp-net-signalr-angularjs-d3js/" rel="noreferrer">http://arulselvan.net/realtime-dashboard-asp-net-signalr-angularjs-d3js/</a> or <a href="http://henriquat.re/server-integration/signalr/integrateWithSignalRHubs.html" rel="noreferrer">http://henriquat.re/server-integration/signalr/integrateWithSignalRHubs.html</a>. They recommend implementing a timer in a class implementing <code>IRegisteredObject</code> from the <code>System.Web.Hosting</code> namespace.</p>
  
  <p>However, I don't seem to be able to locate the namespace where <code>IRegisteredObject</code> lives in ASP.NET 5. <code>System.Web</code> no longer exists in ASP.NET 5.
  I haven't been able to find any info on it online.
  What is the substitute for it in ASP.NET 5?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I am trying the following solution: </p>
  
  <ul>
  <li><p>create a service encapsulating the timer</p></li>
  <li><p>register it in <code>Startup.cs</code> as a singleton service, e.g.</p>
  
  <pre><code>public class Ticker
  {
      Timer timer = new Timer(1000);
      public Ticker()
      {
          timer.Elapsed += Timer_Elapsed;
          timer.Start();
      }
  
      private void Timer_Elapsed(object sender, ElapsedEventArgs e)
      {
        // do something
      }
  }
  </code></pre></li>
  </ul>
  
  <p>In <code>Startup.cs</code></p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
      {
          // ... 
          Ticker ticker = new Ticker();
          ServiceDescriptor sd = new ServiceDescriptor(typeof(Ticker), ticker);
          services.Add(sd);
          // ...
      }
  </code></pre>
  
  <p>How about this approach?</p>