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))
}
I'm seeing if I can use surf with wasi. Unfortunately, the dependencies appear not to be correct, even with
I get a dependency on socket2
Test app is:
Which I've pushed here: https://github.com/ctaggart/try_wasi_async