Skip to content

Conversation

@jensengar
Copy link
Contributor

Since setTimeout get throttled by browsers and setImmediate doesn't actually exist in any browsers, we should use queueMicrotask which works very similarly to the intention of setImmediate.

I have an app that uses stanza.io which relies on async's priorityQueue. It was found that priorityQueue is getting throttled because of its use of setTimeout(fn, 0). Most browsers support queueMicrotask, but for those who don't, we will fallback.

@djhouseknecht
Copy link

For reference:

@jensengar
Copy link
Contributor Author

@sauravazad thanks for the approval. Is there anyone else who needs to approve this? And who has merge/release rights for this?

@aearly
Copy link
Collaborator

aearly commented Aug 5, 2021

I'll merge this later today.

@aearly aearly merged commit 89255fe into caolan:master Aug 5, 2021
@aearly
Copy link
Collaborator

aearly commented Aug 5, 2021

Published in v3.2.1

@jensengar
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants