MCPcopy Create free account
hub / github.com/TruthHun/BookStack / drainQueue

Function drainQueue

static/word2md/mammoth.browser.js:23973–23995  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23971}
23972
23973function drainQueue() {
23974 if (draining) {
23975 return;
23976 }
23977 var timeout = runTimeout(cleanUpNextTick);
23978 draining = true;
23979
23980 var len = queue.length;
23981 while(len) {
23982 currentQueue = queue;
23983 queue = [];
23984 while (++queueIndex < len) {
23985 if (currentQueue) {
23986 currentQueue[queueIndex].run();
23987 }
23988 }
23989 queueIndex = -1;
23990 len = queue.length;
23991 }
23992 currentQueue = null;
23993 draining = false;
23994 runClearTimeout(timeout);
23995}
23996
23997process.nextTick = function (fun) {
23998 var args = new Array(arguments.length - 1);

Callers 1

cleanUpNextTickFunction · 0.70

Calls 2

runTimeoutFunction · 0.70
runClearTimeoutFunction · 0.70

Tested by

no test coverage detected