title: How to run an unblocking background task in a Meteor/JavaScript client?
body: <p>I'd like to run a task on a Meteor client which is resource hungry in the background and keep the interface responsive for the user in the meantime. The task does some math (for example finding prime numbers like described here: <a href="https://stackoverflow.com/a/22930538/2543628">https://stackoverflow.com/a/22930538/2543628</a> ).</p>
  
  <p>I've tried to follow the tips from <a href="https://stackoverflow.com/a/21351966">https://stackoverflow.com/a/21351966</a> but still the interface always "freezes" until the task is complete.</p>
  
  <p>setTimeout, setInterval and those packages like in my current approach also didn't help:</p>
  
  <pre><code>var taskQueue = new PowerQueue();
  taskQueue.add(function(done) {
      doSomeMath();
      // It's still blocking/freezing the interface here until done() is reached
      done();
  });
  </code></pre>
  
  <p>Can I do something to make the interface responsive during doSomeMath() is running or am I doing something wrong (also it doesn't look like there is much you could do wrong in PowerQueue)? </p>