Web workers / shared workers in a browser #464
-
Anyone know if there is support to run the wasm in web / shared workers in the browser ? It’s good for async things that need to call a server and not block the main UI thread .. Then it’s sort of natural to ask if non browser environments also have the same async aspects. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 2 replies
-
Hi, we are working on a new JS SDK that works in Browser, Node, Deno, and Bun environments. But in the meantime, you should be able to use this: |
Beta Was this translation helpful? Give feedback.
-
That makes a lot of sense. i started using bun. So then the web post message ( or shared array ) for passing data between host and workers can us the same mechanism. |
Beta Was this translation helpful? Give feedback.
-
I am hoping the code written to be compiled to wasm can just use stdio. It’s universal . |
Beta Was this translation helpful? Give feedback.
-
@gedw99 once we make the new JS SDK public I'll ping you, would appreciate it if you can try it out and let us know if you have any feedback for your use case |
Beta Was this translation helpful? Give feedback.
-
That would be great . |
Beta Was this translation helpful? Give feedback.
-
@gedw99 the new JS SDK uses workers to make sure the main thread is not blocked, you can try it out here: https://github.com/extism/js-sdk |
Beta Was this translation helpful? Give feedback.
@gedw99 the new JS SDK uses workers to make sure the main thread is not blocked, you can try it out here: https://github.com/extism/js-sdk