-
Notifications
You must be signed in to change notification settings - Fork 245
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
target wasm & wasi too #37
Comments
tokio does not yet work with WebAssembly tokio-rs/tokio#1597. reqwest is tokio based. surf has a use async_executor::{Executor, Task};
use futures_lite::future;
use surf::Result;
fn main() -> Result<()> {
let ex = Executor::new();
let task: Task<Result<()>> = ex.spawn(async {
let ip = surf::get("http://ip.jsontest.com/").await?.body_string().await?;
println!("ip {}", &ip);
Ok(())
});
future::block_on(ex.run(task))
} |
Hi! Here is the very early fork , currently with support only for the blob storage SDK, with a samples repo here. I'll update this issue as I work on it, but as everything is experimental, I don't expect to propose a PR here anytime soon. This is in case interested people want to follow the work. Thanks! |
And here is how we are using the SDK from within WASI modules - https://github.com/deislabs/wagi-azure-samples |
@radu-matei, this looks amazing! I look forward to trying it out once I have time. |
@radu-matei, thanks for the blog post! |
That's cool. Just have a look at the repo at https://github.com/deislabs/wagi-azure-samples. But there are a lot of works to make it runs well with other Rust libs out there, almost based on tokio-rs which couldn't run on WASM right now |
#939 adds a wasm target, which was the goal of this issue. There is more work to be done to support it, but it is progress. |
I think it is an important use case to be able to target wasm & wasi with these crates. We will need to add these targets to CI:
I'm hoping we can get the right features in place to support this. An important part of this is being able to use a different http client like reqwest instead of hyper. The http client abstraction is #36.
The text was updated successfully, but these errors were encountered: