mirror of
https://seed.radicle.dev/rad:z4D5UCArafTzTQpDZNQRuqswh3ury.git
synced 2026-10-18 19:10:45 +08:00
Use tokio::time::sleep instead of blocking threads
Great explanation by @LarsWirzenius on the why > Async code in Rust runs in one or more threads. Usually there's a small number of threads that are multiplexed between different async functions. The async executor chooses what threads to use and which thread runs which async code. If the async code takes a long time, such as by calling std::thread::sleep, the whole thread stops doing anything else, and then no other async code runs in that thread, either.
This commit is contained in:
Generated
+1
@@ -4006,6 +4006,7 @@ dependencies = [
|
||||
"tauri-plugin-shell",
|
||||
"tauri-plugin-window-state",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"ts-rs",
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user