MCPcopy Index your code
hub / github.com/nodejs/node / execute

Function execute

test/common/wpt.js:540–554  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

538 const queue = [];
539
540 const execute = async (fn) => {
541 if (running < concurrency) {
542 running++;
543 try {
544 await fn();
545 } finally {
546 running--;
547 if (queue.length > 0) {
548 execute(queue.shift());
549 }
550 }
551 } else {
552 queue.push(fn);
553 }
554 };
555
556 return execute;
557};

Callers

nothing calls this directly

Calls 3

fnFunction · 0.50
shiftMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…