Desktop: Use tokio async runtime (#3704)
Use tokio because hyper needs it
This commit is contained in:
parent
da518857ad
commit
5ace2c9660
|
|
@ -2363,6 +2363,7 @@ dependencies = [
|
||||||
"ron",
|
"ron",
|
||||||
"serde",
|
"serde",
|
||||||
"thiserror 2.0.16",
|
"thiserror 2.0.16",
|
||||||
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
"vello",
|
"vello",
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ web-sys = { version = "=0.3.77", features = [
|
||||||
winit = { git = "https://github.com/rust-windowing/winit.git" }
|
winit = { git = "https://github.com/rust-windowing/winit.git" }
|
||||||
keyboard-types = "0.8"
|
keyboard-types = "0.8"
|
||||||
url = "2.5"
|
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)
|
# Linebender ecosystem (BEGIN)
|
||||||
kurbo = { version = "0.12", features = ["serde"] }
|
kurbo = { version = "0.12", features = ["serde"] }
|
||||||
vello = { git = "https://github.com/linebender/vello" }
|
vello = { git = "https://github.com/linebender/vello" }
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ winit = { workspace = true, features = [
|
||||||
] }
|
] }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
futures = { workspace = true }
|
futures = { workspace = true }
|
||||||
|
tokio = { workspace = true }
|
||||||
cef = { workspace = true }
|
cef = { workspace = true }
|
||||||
cef-dll-sys = { workspace = true }
|
cef-dll-sys = { workspace = true }
|
||||||
tracing-subscriber = { workspace = true }
|
tracing-subscriber = { workspace = true }
|
||||||
|
|
|
||||||
|
|
@ -70,8 +70,9 @@ impl App {
|
||||||
let rendering_app_event_scheduler = app_event_scheduler.clone();
|
let rendering_app_event_scheduler = app_event_scheduler.clone();
|
||||||
let (start_render_sender, start_render_receiver) = std::sync::mpsc::sync_channel(1);
|
let (start_render_sender, start_render_receiver) = std::sync::mpsc::sync_channel(1);
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
|
let runtime = tokio::runtime::Runtime::new().unwrap();
|
||||||
loop {
|
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));
|
rendering_app_event_scheduler.schedule(AppEvent::NodeGraphExecutionResult(result));
|
||||||
let _ = start_render_receiver.recv();
|
let _ = start_render_receiver.recv();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue