MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / drainQueue

Function drainQueue

code/communication/public/app.js:903–925  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

901}
902
903function drainQueue() {
904 if (draining) {
905 return;
906 }
907 var timeout = runTimeout(cleanUpNextTick);
908 draining = true;
909
910 var len = queue.length;
911 while(len) {
912 currentQueue = queue;
913 queue = [];
914 while (++queueIndex < len) {
915 if (currentQueue) {
916 currentQueue[queueIndex].run();
917 }
918 }
919 queueIndex = -1;
920 len = queue.length;
921 }
922 currentQueue = null;
923 draining = false;
924 runClearTimeout(timeout);
925}
926
927process.nextTick = function (fun) {
928 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