-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
WASM Support on twilight-http #1972
Comments
Hi Alex, As far as I know, the As from my experience, most HTTP operations are asynchronous which require some sort of an asynchronous runtime to run. There are two commonly-used asynchronous runtimes in the Rust ecosystem: Hope this helps. Regards, Edit: cc @Erk-, who have worked on this before. |
Hi! Thanks for your reply. The rust Thus I basically just want to use a "simple" wasm compatible version of If I saw correctly After looking a bit more at the code, I feel this could be a bigger problem then initially anticipated, but it may still be an interesting feature to have. |
Hi Alex, Upon closer inspection, the features There's another solution: gate Not really sure is that the best way, but upon discussion in the Discord that might worth a go. Hope this helps. Regards, |
Hey, thanks for coming back on that. As long as the features from Gate But either way, if it's too much effort to implement those changes we can wait for the WASM PR on I still have concerns with tokio, but that needs to be tested. Best Regards |
Hello,
This was the way I ran with when I tried this in the past, though got stuck on various things such as missing support in tokio and some types being a bit too different between them to make it clean. I might give it another try this weekend and see if I can get something working with either the hyper patch or by not using hyper. ========== |
Hey there! |
I have not had time to look at it much yet, the hyper wasm cannot be used directly at least since it seems to cause other issues. So I will look into maybe abstracting the http client away though that is quite a bit more work |
Cloudflare workers allow using wasm and wasi, to use apis from js it requires using https://github.com/seanmonstar/reqwest/blob/master/src/wasm/client.rs There is no way to run a normal hyper client with wasm. Hyper is build on h1 and h2 that are http implementations. js build-in api's simply doesn't provide enough abilities to achieve same level of details to expose api with exact same data and methods. What about WASI? https://github.com/WebAssembly/wasi-sockets WASI is supported by cloudflare workers and would not require any additional work here (if there will be proper apis in place to cover tokio/net). |
Hey there!
I recently started working on writing a Cloudflare Worker library for Interactions using
twilight-model
andtwilight-http
, thoughtwilight-http
uses tokio, which is currently not supported by Cloudflare Workers.Is there any chance to get a feature which does not compile tokio and makes it possible to compile to WASM?
Thank you & Best Regards
Alex
The text was updated successfully, but these errors were encountered: