Support a runImmediate flag to avoid processing delays #3053
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist:
npm test
locally and all tests are passing. (I'm relying on the CI for this, as the tests don't run on my environment to begin with)PR Description
This is particularly useful in web environments where setImmediate() may be temporarily paused by the browser. When a high resource usage tab is put in the background, browsers often pause timer usage until the app is foregrounded again. For some web applications, performing background network requests even when backgrounded itself is useful and may wish to avoid use of setImmediate, understanding the risk in potentially doing so.