Skip to content

How to properly call an async function inside state management with tauri command? #6531

Answered by FabianLars
Hellager asked this question in Q&A
Discussion options

You must be logged in to vote

One simple workaround would be to use tokio's mutex which can be held across an await https://docs.rs/tokio/latest/tokio/sync/struct.Mutex.html (also re-exported as tauri::async_runtime::Mutex

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Hellager
Comment options

Answer selected by Hellager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants