zed/crates/gpui_web
Cole Miller 82aef44308
gpui: Add an abstraction for scheduling foreground work for idle periods, and implement it for the web (#61827)
- Add `ForegroundExecutor::spawn_when_idle(timeout, future)`, which
schedules `future` to be polled on the main thread when the main thread
is idle, but tries to do so no later than `timeout` after the current
instant (with the same `timeout` being applied to subsequent polls of
the same future)
- Add `Platform::dispatch_on_main_thread_when_idle(runnable, timeout)`
as the basis for `spawn_when_idle`, with a default implementation that
ignores the timeout and delegates to `dispatch_on_main_thread(runnable,
Priority::Low)`
- Implement `dispatch_on_main_thread_when_idle` for the web platform
using
[`requestIdleCallback`](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback)

Release Notes:
- N/A
2026-07-29 06:41:29 +00:00
..
examples/hello_web GPUI on the web (#50228) 2026-02-26 18:36:50 +01:00
src gpui: Add an abstraction for scheduling foreground work for idle periods, and implement it for the web (#61827) 2026-07-29 06:41:29 +00:00
Cargo.toml gpui: Add an abstraction for scheduling foreground work for idle periods, and implement it for the web (#61827) 2026-07-29 06:41:29 +00:00
LICENSE-APACHE GPUI on the web (#50228) 2026-02-26 18:36:50 +01:00