Skip to content

Add option to use Window.requestIdleCallback() for ControlFlow::Poll#3084

Merged
daxpedda merged 1 commit intorust-windowing:masterfrom
daxpedda:web-request-idle-callback-2
Sep 7, 2023
Merged

Add option to use Window.requestIdleCallback() for ControlFlow::Poll#3084
daxpedda merged 1 commit intorust-windowing:masterfrom
daxpedda:web-request-idle-callback-2

Conversation

@daxpedda
Copy link
Copy Markdown
Member

@daxpedda daxpedda commented Sep 3, 2023

This PR builds on top of #3056 and adds a new extension method on EventLoopWindowTarget to set the strategy for ControlFlow::Poll. By default the Prioritized Task Scheduling API is used, this adds the option to use Window.requestIdleCallback() instead.

Both strategies fallback on setTimeout() when not available.

Cc @GloopShlugger.
Originally implemented in #2880 and then reverted in #3044.
Requires #3056.

@daxpedda daxpedda added the DS - web Affects the Web backend (WebAssembly/WASM) label Sep 3, 2023
@daxpedda daxpedda force-pushed the web-request-idle-callback-2 branch from 577db5f to 43aa7b0 Compare September 3, 2023 19:32
@daxpedda daxpedda mentioned this pull request Sep 3, 2023
25 tasks
@daxpedda daxpedda force-pushed the web-request-idle-callback-2 branch from 43aa7b0 to f1d6191 Compare September 7, 2023 09:49
@daxpedda daxpedda force-pushed the web-request-idle-callback-2 branch from f1d6191 to 53bff7f Compare September 7, 2023 10:01
@daxpedda daxpedda merged commit 83950ac into rust-windowing:master Sep 7, 2023
kchibisov pushed a commit to kchibisov/winit that referenced this pull request Oct 17, 2023
kchibisov pushed a commit that referenced this pull request Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DS - web Affects the Web backend (WebAssembly/WASM)

Development

Successfully merging this pull request may close these issues.

1 participant