-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AppHandle is not Send + Sync on Windows #2343
Comments
I've since refactored my code to work around this issue but the inconsistent behaviour remains... |
Nevermind, cross compilation still fails. I cannot send the AppHandle to long running background tokio tasks. Here are some more compiler errors: Note that The error wrt to tracing is because I am forwarding tracing log messages to the developer console in the tauri window. For that to work I really need the AppHandle to be
|
With regards to this error:
Wrapping the AppHandle with an
|
I believe |
I think AppHandle only needs to be Send since it implements Clone so it's easy to manage it. But it needs to be consistent across platforms. |
For |
I'll take a look on Windows. |
I just checked https://docs.rs/tao/0.4.0/tao/event_loop/struct.EventLoopProxy.html and https://docs.rs/tao/0.4.0/x86_64-pc-windows-msvc/tao/event_loop/struct.EventLoopProxy.html |
I'm thinking about maybe we could use channel from |
@wusyong can you patch it in tao? Yesterday I saw that tao 0.5 has a breaking change on macOS because it's no longer Sync (it used to work, now the same code only works on Linux and I had to make some changes). |
|
Hello,
My Cargo.toml:
I have a tauri application that compiles fine on Linux but when cross compiling to Windows I get the following error:
and
I am holding on to a tauri AppHandle in my application state. My application state is managed with a tauri Application via
manage()
.Also, as far as I can tell
tao::event_loop::EventLoopProxy
isSend + Sync
on Linux but onlySend
on Windows.Windows:
https://github.com/tauri-apps/tao/blob/0d6fcde47a1dd587a7ac2c209d330169496d4c46/src/platform_impl/windows/event_loop.rs#L491
Linux:
https://github.com/tauri-apps/tao/blob/0d6fcde47a1dd587a7ac2c209d330169496d4c46/src/platform_impl/linux/event_loop.rs#L795
I'm not too phased about whether the AppHandle can be kept within tauri managed state but the bahaviour should be consistent across platform.
The text was updated successfully, but these errors were encountered: