title: Is there any way to be notified when callback of asyncFetch is called?
body: <p>My code looks like:</p>
  
  <pre><code>NetUtil.asyncFetch(url, function(inputStream, status) {
      var binaryOutputStream = Components.classes['@mozilla.org/binaryoutputstream;1'].createInstance(Components.interfaces['nsIBinaryOutputStream']);
      var storageStream = Components.classes['@mozilla.org/storagestream;1'].createInstance(Components.interfaces['nsIStorageStream']);
      var count = inputStream.available();
      var data = NetUtil.readInputStreamToString(inputStream, count);
  
      storageStream.init(512, count, null);
      binaryOutputStream.setOutputStream(storageStream.getOutputStream(0));
      binaryOutputStream.writeBytes(data, count);
  
      global_storageStream = storageStream;
      global_count = count;
  })
  </code></pre>
  
  <p>The logic requires the main process to keep being blocked until global_storageStream and global_counter are set.</p>
  
  <p>How can I do?</p>