synchronous execution in a tokio::spawn
#6857
-
I spawned a new thread with fn prepare_result_files(app: tauri::AppHandle, audio_file_id: i32, results: Vec<ResultFile>) {
debug!("Preparing result files: {:?}", audio_file_id);
let id = audio_file_id.to_string();
tokio::spawn(async move {
save_result_files(&id, &results).await;
download_result_files(&id, results).await;
prepare_tracks();
prepare_players(&id).await;
let _ = app.emit_all(PLAYER_IS_READY, audio_file_id);
});
} The problem is that the Any pointers? SO thread. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Async/await executes operations one line at the time, so |
Beta Was this translation helpful? Give feedback.
-
Ok, I think this is a bug somewhere else. Thanks for the reply @Darksonn |
Beta Was this translation helpful? Give feedback.
Async/await executes operations one line at the time, so
emit_all
does not get called before the.await
operations before it finish.