Desktop: Use tokio async runtime (#3704)

Use tokio because hyper needs it
This commit is contained in:
Timon 2026-02-02 12:49:15 +01:00 committed by GitHub
parent da518857ad
commit 5ace2c9660
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 2 deletions

1
Cargo.lock generated
View File

@ -2363,6 +2363,7 @@ dependencies = [
"ron",
"serde",
"thiserror 2.0.16",
"tokio",
"tracing",
"tracing-subscriber",
"vello",

View File

@ -179,7 +179,7 @@ web-sys = { version = "=0.3.77", features = [
winit = { git = "https://github.com/rust-windowing/winit.git" }
keyboard-types = "0.8"
url = "2.5"
tokio = { version = "1.29", features = ["fs", "macros", "io-std", "rt"] }
tokio = { version = "1.29", features = ["fs", "macros", "io-std", "rt", "rt-multi-thread"] }
# Linebender ecosystem (BEGIN)
kurbo = { version = "0.12", features = ["serde"] }
vello = { git = "https://github.com/linebender/vello" }

View File

@ -31,6 +31,7 @@ winit = { workspace = true, features = [
] }
thiserror = { workspace = true }
futures = { workspace = true }
tokio = { workspace = true }
cef = { workspace = true }
cef-dll-sys = { workspace = true }
tracing-subscriber = { workspace = true }

View File

@ -70,8 +70,9 @@ impl App {
let rendering_app_event_scheduler = app_event_scheduler.clone();
let (start_render_sender, start_render_receiver) = std::sync::mpsc::sync_channel(1);
std::thread::spawn(move || {
let runtime = tokio::runtime::Runtime::new().unwrap();
loop {
let result = futures::executor::block_on(DesktopWrapper::execute_node_graph());
let result = runtime.block_on(DesktopWrapper::execute_node_graph());
rendering_app_event_scheduler.schedule(AppEvent::NodeGraphExecutionResult(result));
let _ = start_render_receiver.recv();
}