mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
committed by
GitHub
parent
4bdc406679
commit
df21ffc61f
5
.changes/command-message-blocking.md
Normal file
5
.changes/command-message-blocking.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
Fixes child processes messages not arriving until the subprocess is terminated.
|
||||
@@ -102,8 +102,9 @@ impl Cmd {
|
||||
let pid = child.pid();
|
||||
command_childs().lock().unwrap().insert(pid, child);
|
||||
|
||||
crate::async_runtime::spawn(async move {
|
||||
while let Some(event) = rx.recv().await {
|
||||
// TODO: for some reason using `crate::async_runtime::spawn` and `rx.recv().await` doesn't work here, see issue #1935
|
||||
std::thread::spawn(move || {
|
||||
while let Some(event) = rx.blocking_recv() {
|
||||
if matches!(event, crate::api::process::CommandEvent::Terminated(_)) {
|
||||
command_childs().lock().unwrap().remove(&pid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user