MCPcopy Index your code
hub / github.com/ampproject/amphtml / dequeue

Method dequeue

src/service/task-queue.js:92–100  ·  view source on GitHub ↗

* Dequeues the task and returns "true" if dequeueing is successful. Otherwise * returns "false", e.g. when this task is not currently enqueued. * @param {!TaskDef} task * @return {boolean}

(task)

Source from the content-addressed store, hash-verified

90 * @return {boolean}
91 */
92 dequeue(task) {
93 const existing = this.taskIdMap_[task.id];
94 const dequeued = this.removeAtIndex(task, this.tasks_.indexOf(existing));
95 if (!dequeued) {
96 return false;
97 }
98 this.lastDequeueTime_ = Date.now();
99 return true;
100 }
101
102 /**
103 * Returns the task with the minimal score based on the provided scoring

Callers 7

test-task-queue.jsFile · 0.45
toArrayFunction · 0.45
nextTask_Method · 0.45
work_Method · 0.45
taskComplete_Method · 0.45
schedule_Method · 0.45

Calls 2

removeAtIndexMethod · 0.95
nowMethod · 0.80

Tested by

no test coverage detected