Replies: 3 comments 3 replies
-
|
Turns out the spawn was taking place in a function that, in turn was called by another function from an actix_rt context. That's because actix_rt allows !Send futures, and the web server functions I'm reusing in tauri are !Send. However, the actix_rt context is single threaded which doesn't work well with the job manager, at least sometimes? Still not sure why the job manager works in the web server which also uses actix_rt, but it does. What's wild is that in tauri, putting a 100ms sleep after the tokio::spawn() makes it work fine. |
Beta Was this translation helpful? Give feedback.
-
|
thanks!! I added sleep and it finally works :D I spent 6 hours trying to fix it... |
Beta Was this translation helpful? Give feedback.
-
|
I have also encountered this. I didn't manage to solve it. I ended up just making enough refactors that I didn't need to run a nested and it was |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
My program started as a web server, which is now in a library and gets linked in to a tauri app.
I'm added a (3rd party) job manager crate to the library and that job manager uses tokio::spawn to kick off new tasks. In the actix-web server it works.
But in tauri it seems something goes wrong; the job manager posts a message ("Starting job") from just before the tokio::spawn point, but no messages are ever sent from inside the task itself. So it seems that tokio::spawn is silently failing.
I've tried making the tokio handler async and not. No difference.
I'm not really too up on tokio failure modes. Why would tokio::spawn quietly not work from inside a tauri handler? What should I look for?
Beta Was this translation helpful? Give feedback.
All reactions