Comments (5)
In fact, even AsyncFileDialog
is block, .await
means the task will blocked until it complete
to solve it, I think you should spawn another task to call AsyncFileDialog
, and let your main loop check whether it is completed.
from rfd.
Yes, but in the current code, the thread that the executor is running on is blocked, because the future blocks when polled. This means that no other futures can be executed while the file dialog is open, and if the executor is running on the main thread, the application itself will freeze. That's what I'm fixing.
from rfd.
In fact, even
AsyncFileDialog
is block,.await
means the task will blocked until it complete
That's not how Future
s work in Rust. When you await
a future, it doesn't block the thread; it causes the task to "yield" (within whatever executor you're using, it'll move on to the next task to be executed, and probably won't poll that future again until the task is awoken).
from rfd.
@valadaptive I mean, the thread won't be blocked, but the task will be blocked, even it's async
from rfd.
Related Issues (20)
- [BUG] Dialog not showing up with `xdg-desktop-portal > 1.16` HOT 13
- [feature] filter for filename
- Tokio support
- Web implementation does not handle dark mode gracefully HOT 4
- How to actually use AsyncFileDialog in WASM? HOT 1
- Save Dialog locks up when selecting an Existing File and clicking the Save button. (Windows 10) HOT 5
- File dialog freeze when use in JNI
- New file dialog HOT 2
- rfd 0.14 has dependency conflicts for winit apps on macOS HOT 7
- TaskDialogIndirect doesn't work for some reason.
- Crash when attempting to open FileDialogue (MacOS)
- Linux message dialogues displaying "All updates are complete"
- Wasm inline style clashes with CSP headers HOT 1
- Lastest version 0.14.1 not available at crates.io HOT 2
- FileDialog blocking forever
- Reconsider usage of the changelog action
- Not dialog appeared, return none HOT 2
- Dialog does not appear in WSL HOT 1
- Any way to pick a file or a folder? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rfd.