title: Debounce and buffer an rxjs subscription
body: <p>I have a message queue processor that feeds messages to a service...</p>
  <pre class="lang-js prettyprint-override"><code>q.on(&quot;message&quot;, (m) =&gt; {
    service.create(m)
      .then(() =&gt; m.ack())
      .catch(() =&gt; n.nack())
  })
  </code></pre>
  <p>The service uses an RxJS Observable and subscription to <code>debounceTime()</code> those requests.</p>
  <pre class="lang-js prettyprint-override"><code>class Service {
    constructor() {
      this.subject = new Subject()
      this.subject.debounceTime(1000)
        .subscribe(({ req, resolve, reject }) =&gt;
          someOtherService.doWork(req)
            .then(() =&gt; resolve())
            .catch(() =&gt; reject())
        )
    }
  
    create(req) {
      return new Promise((resolve, reject) =&gt;
        this.subject.next({
          req,
          resolve,
          reject
        })
      )
    }
  }
  </code></pre>
  <p>The issue is that only the debounced request gets ackd/nackd.  How can I ensure that the subscription also resolves/rejects the other requests?  <code>bufferTime()</code> gets me a part of the way there, but it does not reset the timeout duration on each call to <code>next()</code>.</p>