title: How can I implement a queue using Rxjs?
body: <p>With promises, it's really easy to implement a queue to prevent for example multiple HTTP requests from running in parallel:</p>
  
  <pre><code>class Runner {
    private promise;
    constructor(http) {
      this.promise = q.resolve();
    }
    getUrl() {
      return this.promise = this.promise.then(() =&gt; http.get('http://someurl'))
    }
  }
  
  var runner = new Runner(http);
  
  var lastPromise;
  for (var i = 0; i &lt; 10; i++) {
    lastPromise = runner.getUrl();
  }
  
  lastPromise.then(() =&gt; console.log("job's done!");
  </code></pre>
  
  <p>I can't figure out how to do this in Rxjs tho. If I try something similar to the above, all previous HTTP calls get repeated when I add a request because it just adds to the stream and reruns the whole thing.</p>
  
  <p>I read something about a queue scheduler, but that doesn't seem to exist (anymore)?</p>