Running task.cancelAll() on a task that is part of a group cancels all the tasks in the group.
Shouldn't fooTask.cancelAll() just cancel all the Foo tasks? and group.cancelAll() cancel all the tasks in a group?
In the below example, primaryQueueTask and backgroundQueueTask are members of queueGroup to limit maxConcurrency between them. backgroundQueueTask is an idle queue that runs only when there's no work to be done in primaryQueueTask.
When backgroundQueueTask.cancelAll() is run, all the tasks in primaryQueueTask get cancelled too.
Is this a bug?
init() {
this._super(...arguments);
//define property on init to use some dynamic values
defineProperty(
this,
"queueGroup",
taskGroup()
.maxConcurrency(this.concurrentItems)
.enqueue()
);
},
primaryQueueTask: task(function*(component) {
yield timeout(1000);
}).group("queueGroup").debug(),
backgroundQueueTask: task(function*(component) {
if (this.primaryQueueTask.isQueued) {
this.backgroundQueueTask.cancelAll()
return;
}
yield timeout(1000);
}).group("queueGroup").debug()
Debug
TaskInstance 'backgroundQueueTask' was canceled because .cancelAll() was explicitly called on the Task.
TaskInstance 'primaryQueueTask' was canceled because .cancelAll() was explicitly called on the Task.
Running
task.cancelAll()
on a task that is part of a group cancels all the tasks in the group.Shouldn't
fooTask.cancelAll()
just cancel all the Foo tasks? andgroup.cancelAll()
cancel all the tasks in a group?In the below example,
primaryQueueTask
andbackgroundQueueTask
are members ofqueueGroup
to limit maxConcurrency between them.backgroundQueueTask
is an idle queue that runs only when there's no work to be done inprimaryQueueTask
.When
backgroundQueueTask.cancelAll()
is run, all the tasks inprimaryQueueTask
get cancelled too.Is this a bug?
Debug