Add fast resource transfer management

This commit is contained in:
2020-05-08 21:00:47 +03:00
parent f648f7dd5a
commit 304c192ab0
8 changed files with 79 additions and 50 deletions

View File

@ -42,9 +42,11 @@ export class TaskQueue {
return modifiedCount;
}
remove(id: TaskId) {
const [_, items] = this.shiftTask(id);
this.flushItems(items);
remove(predicate: (t: Task) => boolean): number {
const [_, other] = this.split(predicate);
const result = other.length;
this.flushItems(other);
return result;
}
seeItems(): ImmutableTaskList {