7

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 1

3

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".

Sign up to request clarification or add additional context in comments.

3 Comments

and... it wouldn't truely be access to the callback queue. :p
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.
If you are trying to just play around with it so you can learn more, maybe the EventEmitter in node is worth checking out.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.