Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question: when is memory for each queued function garbage collected? #19

Closed
stlbucket opened this issue Jan 11, 2020 · 1 comment
Closed

Comments

@stlbucket
Copy link

if you put 1000 functions into a queue, will the memory for each be managed along the way or will they all be garbage collected after all promises are resolved?

@sindresorhus
Copy link
Owner

Can you show an example of what you mean? Are you talking about the limit() function or the function passed to limit()? If the former, it's up to you how long it's stored. If you use Promise.all(), it's stored until the end. If the latter, it's released after being called, so along the way.

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

No branches or pull requests

2 participants