MCPcopy Index your code
hub / github.com/d3/d3-queue / task

Function task

test/abortableTask.js:5–24  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

3 counter = {scheduled: 0, aborted: 0};
4
5 function task(callback) {
6 var index = counter.scheduled++;
7 ++active;
8 var timeout = setTimeout(function() {
9 timeout = null;
10 try {
11 callback(null, {active: active, index: index});
12 } finally {
13 --active;
14 }
15 }, delay);
16 return {
17 abort: function() {
18 if (timeout) {
19 timeout = clearTimeout(timeout);
20 ++counter.aborted;
21 }
22 }
23 };
24 }
25
26 task.aborted = function() {
27 return counter.aborted;

Callers

nothing calls this directly

Calls 1

callbackFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…