Skip to content
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

Calling async functions from trunk #466

Closed
emilk opened this issue Dec 5, 2022 · 2 comments
Closed

Calling async functions from trunk #466

emilk opened this issue Dec 5, 2022 · 2 comments

Comments

@emilk
Copy link

emilk commented Dec 5, 2022

As I understand it, trunks one and only entrypoint is fn main, which cannot be async, which means we cannot call async code in trunk apps, which is sad.

This came up today when I realized eframe::start_web is now async (since emilk/egui#2107), and eframe_template uses trunk. (This async stuff was added in order to support WebGPU).

@thedodd
Copy link
Member

thedodd commented Dec 5, 2022

Hmm, this appears to be a misunderstanding. Trunk has nothing to do with the application which is ultimately executed/run in the browser. Trunk compiles and bundles assets, but does not dictate how the application itself is structured.

Any limitations on that front will be dictated by wasm-bindgen actually, which is the framework used to run rust wasm applications.

Please feel free to re-open if you think I have misunderstood your comments here :)

@thedodd thedodd closed this as completed Dec 5, 2022
@emilk
Copy link
Author

emilk commented Dec 5, 2022

Ah, I see. Thanks for the clarification!

For posterity, here is the required fix: emilk/eframe_template#83

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants