Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdds timeout option to requestIdleCallback #1615
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
Fenny
commented
May 15, 2019
|
Review please |
|
This seems important. Thanks! |
This comment has been minimized.
This comment has been minimized.
|
0.107.11 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
guanzo commentedApr 17, 2019
•
edited
This is a modification of a previous pull request: #1513
Downloads will sometimes stall for several seconds, then resume after I click on the page, or blur the current window, or in any way cause
requestIdleCallbackto trigger. In some cases, the callback will never trigger if I reload the page and don't interact with it.Delayed downloads are fine for streaming media since the user can consume the beginning chunks while later chunks get throttled, but for static media like images which need to render ASAP, the delayed download is counter productive.
I propose adding the
timeoutoption which will guarantee that the callback runs in a reasonable time, while still allowing some idle time.Note that the MDN docs recommend a timeout.