I have some components that use the wasi:http
shim to make network calls. I initially assumed these would be totally blocking, but when looking through the @bytecodealliance/preview2-shim
code I noticed the lib/io/worker-*
files that seem to imply some of the wasi:*
backed IO is happening in a Worker
and is not blocking.
Curious if this is all piped in with jco
's functionality by default or if I would need to do some special configuration to use the worker-*
versions of the shims? I've been exploring instantiating/calling my components in a Worker
thread to avoid blocking, but if it is already non-blocking that would be great!
@Landon James yes we have a "non-blocking" polls implementation but this is only currently supported in Node.js. Supporting the browser is the next priority now that this implementation has been completed, but that work will be a little while still.
Ahh great to hear, I am only looking to support Node at the moment. Do I need to do anything to enable that? I see that the nodejs/http.js
implementation is only pulling in the worker-io
stuff at the moment, so not sure if that is fully non-blocking yet? Happy to contribute some work here once I figure out what needs to be done since this would be more helpful than wrapping all my own stuff in Worker
s.
oh, yeah it should all work out in Node.js if you use the default transpile options - http is fully supported
Last updated: Dec 23 2024 at 13:07 UTC