Skip to content Skip to sidebar Skip to footer

Javascript Event Loop: Queue Vs Message Queue Vs Event Queue

Reading through a lot of JavaScript Event Loop tutorials, I see different terms to identify the queue stores messages ready to be fetched by the Event Loop when the Call Stack is e

Solution 1:

Good question, I'm also a advocate of using proper terminology.

Queue, message queue, and event queue are referring to the same construct (event loop queue). This construct has the callbacks which are fired in the event loop.

Interestingly there are two different queues the job queue and the event loop queue. The job queue is specifically designed for promises. The job queue has a higher priority than the event loop queue, so if there are both callbacks available in both queues the ones in the job queue will be put on the stack first.

Hopefully this answers your question.

Post a Comment for "Javascript Event Loop: Queue Vs Message Queue Vs Event Queue"