Visualizing the Check Queue in the Node.js Event Loop


Welcome to the sixth article in our series on visualizing the Node.js event loop. In [the previous article], we explored the I/O Polling phase, and briefly understood the check queue and how to enqueue

`

// index.js
const fs = require("fs");
fs.readFile(__filename, () => {
  console.log("this is readFile 1");
  setImmediate(() => console.log("this is setImmediate 1"));
});
process.nextTick(() => console.log("this is process.nextTick 1"));
Promise.resolve().then(() => console.log("this is Promise.resolve 1"));
setTimeout(() => console.log("this is setTimeout 1"), 0);

for (let i = 0; i < 2000000000; i++) {}