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

Add wasm in web worker example #2556

Merged
merged 1 commit into from
May 18, 2021
Merged

Add wasm in web worker example #2556

merged 1 commit into from
May 18, 2021

Conversation

sgasse
Copy link
Contributor

@sgasse sgasse commented May 14, 2021

This commit adds a parallel execution example in which we spawn a web
worker with web_sys, run WASM code in the web worker and interact
between the main thread and the web worker.

It is intended to add an easy starting point for parallel execution
with WASM, complementing the more involved parallel raytrace example.

Related to GitHub issue #2549

@@ -0,0 +1,71 @@
# WASM in Web Worker

[View full source code][code]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that other examples not only point to the code but also to a compiled demo - but that is not autogenerated for each example, right?

@alexcrichton
Copy link
Contributor

Thanks!

I think CI needs to be tweaked though when building this example?

This commit adds a parallel execution example in which we spawn a web
worker with `web_sys`, run WASM code in the web worker and interact
between the main thread and the web worker.

It is intended to add an easy starting point for parallel execution
with WASM, complementing the more involved parallel raytrace example.

Related to GitHub issue #2549
@sgasse
Copy link
Contributor Author

sgasse commented May 17, 2021

Ah yes, I missed that another test failed ^^
If I understood the error correctly, then it failed to build my example because there is no package.json. Though that should also not be there since I made an example to be built with --target no-modules. So I added an ignore case (just like for without-a-bundler - is that right?

@alexcrichton
Copy link
Contributor

Yep that's fine!

@alexcrichton alexcrichton merged commit 78a3721 into rustwasm:master May 18, 2021
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

Successfully merging this pull request may close these issues.

2 participants