I've some articles on how the event loop works. My question is whether there's some way I can access the current queue of functions that are scheduled to be executed. Just for fun.
1 Answer
Not normally, it's all behind the scenes.
The only way you could do it would be to overload the functions like addEventListener and dispatch so you can add in some of your own logic and then watch them, but that would be a lot of work "just for fun".
3 Comments
user400654
and... it wouldn't truely be access to the callback queue. :p
samanime
Correct. You'd basically have to implement your own parallel queue to see it, and you'd only be looking at your parallel one which could deviate if not implemented correctly.
pppetrov
If you are trying to just play around with it so you can learn more, maybe the EventEmitter in node is worth checking out.