title: How to find out if there is a request pending on SignalR client?
body: <p>I'm trying to figure out whether there are any pending requests on the SignalR client so that I can show a "Loading" indicator until all of the requests are processed. Here is what I am doing currently:</p>
  
  <pre><code>// some variable to hold whether there are pending requests
  var isProcessing = false;
  
  
  function ProcessSomeData(data)
  {
      isProcessing = true;
  
      hub.server.setUserData(data).done(function () {
          isProcessing = false;
      });
  }
  </code></pre>
  
  <p>Then I look at <code>isProcessing</code> to see if all the requests are processed. This is inaccurate (sometimes <code>isProcessing</code> gets set to false when there are still requests in progress), so I was wondering if there is a way to determine whether the SignalR client is "busy" processing requests or just idle. Any ideas?</p>