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

Always return promise, even if waitTime is zero #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

StevenACoffman
Copy link

For #1 this removes the conditional, such that for waitTime of 0, setTimeout pushes the callback function to the end of the execution queue. If after setTimeout(callback, 0) you have blocking code which takes time to run, the callback will not be executed until the blocking code has finished.

This allows different requests with zero waitTime retries to yield to one another between attempts, and simplifies the code.

@flexdinesh
Copy link
Owner

@StevenACoffman Thanks for the PR. I don't see a difference this is gonna make. The purpose is to have the default behavior when the timeout is 0.

Can you please eloborate this a bit with cases?

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.

2 participants