chore: reorg

This commit is contained in:
2020-10-17 11:57:50 +08:00
parent 5e48a69aa0
commit 974545fc7c
3 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
fn main() {
futures::executor::block_on(get_all());
}
async fn get_all() {
let mut v = vec![];
for _ in 0..10 {
v.push(get_url("https://www.baidu.com/"));
}
futures::future::join_all(v).await;
}
async fn get_url(url: &str) {
println!("Start get: {}", url);
let r = isahc::get_async(url).await;
match r {
Err(e) => println!("Get response error: {}", e),
Ok(o) => println!("Response: {:?}", o.status()),
};
}