machty / ember-concurrency

ember-concurrency is an Ember Addon that enables you to write concise, worry-free, cancelable, restartable, asynchronous tasks.
http://ember-concurrency.com
MIT License
689 stars 157 forks source link

.numRunning seems to not being decremented in case the generator throws an error #311

Closed azhiv closed 3 years ago

azhiv commented 5 years ago
task: task(function * (input) {
  yield input.toLowerCase();
})

try {
  await this.task.perform(1);
} catch(e) {
} finally {
  console.log(this.task.state);         // 'running'
  console.log(this.task.numRunning);    // 1 
  console.log(this.task.last);          // null
}

Is this expected or am I missing something?

maxfierke commented 3 years ago

This should be fixed in 2.0.0, but feel free to ping for re-open if not.