title: SIgnalR- not use singleton pattern
body: <p>In my application, I am sending real-time updates to each client based on his subscriptions. <br/>
  So e.g. if a client is subscribed to items 1,2 &amp; 3 he should only see updates from these items while at the same time if another client is subscribed to items 4,5 &amp; 6 then he should be able to receive real-time updates for those items. <br/>
  My problem is as soon as I connect with the second id <code>SignalR</code> forgets about the old group and starts notification of new ids only.<br/>
  I guess it's because there's only one instance of real-time updates is running and it's being shared among all connected clients. <br/> Is there a way that each connected client has its own instance of a real-time object?</p>
  <pre><code>public class DataHub : Hub
  {
      private readonly RealTimeData data;
  
      public DataHub() : this(RealTimeData.Instance) { }
  
      public DataHub(RealTimeData rdata)
      {
          data = rdata; //can I instantiate RealTimeData object here?
      }
  
      public void Start(Int64 routerId)
      {
          data.StartTimer(routerId);
      }
  }
  
  public class RealTimeData
  {
      private readonly static Lazy&lt;RealTimeData&gt; _instance = new Lazy&lt;RealTimeData&gt;(() =&gt; new RealTimeData(GlobalHost.ConnectionManager.GetHubContext&lt;DataHub&gt;().Clients));  //will avoiding this create a separate instance for each client? 
      private IHubConnectionContext Clients;
  
      public Timer timer;
      private readonly int updateInterval = 1000;
      private readonly object updateRecievedDataLock = new object();
      private bool updateReceivedData = false;
      List&lt;Items&gt; allItems = new List&lt;Items&gt;();
      private RealTimeData()
      {
      }
  
      private RealTimeData(IHubConnectionContext clients)
      {
          Clients = clients;
      }
  
      public static RealTimeData Instance
      {
          get
          {
              return _instance.Value;
          }
      }
  
      public void StartTimer(Int64 routerId)
      {
          this.routerId = routerId;
          timer = new Timer(GetDataForAllItems, null, updateInterval, updateInterval);
      }
  
      public void GetDataForAllItems(object state)
      {
          if (updateReceivedData)
          {
              return;
          }
          lock (updateRecievedDataLock)
          {
              if (!updateReceivedData)
              {
                  updateReceivedData = true;
                  //get data from database
                  allItems = Mapper.Instance.GetDataForAllItems(routerId);
                  updateReceivedData = false;
                  //send it to the browser for update
                  BroadcastData(allItems);
              }
          }
      }
  }
  </code></pre>