calling only
This commit is contained in:
22
src/main.rs
22
src/main.rs
@@ -1,30 +1,24 @@
|
|||||||
use color_eyre::Report;
|
use color_eyre::Report;
|
||||||
use reqwest::Client;
|
use reqwest::Client;
|
||||||
use tokio::time::sleep;
|
|
||||||
use std::time::Duration;
|
|
||||||
use tracing::info;
|
use tracing::info;
|
||||||
use tracing_subscriber::EnvFilter;
|
use tracing_subscriber::EnvFilter;
|
||||||
|
|
||||||
mod dumb;
|
|
||||||
|
|
||||||
pub const URL_1: &str = "https://fasterthanli.me/articles/whats-in-the-box";
|
pub const URL_1: &str = "https://fasterthanli.me/articles/whats-in-the-box";
|
||||||
pub const URL_2: &str = "https://fasterthanli.me/series/advent-of-code-2020/part-13";
|
pub const URL_2: &str = "https://fasterthanli.me/series/advent-of-code-2020/part-13";
|
||||||
|
|
||||||
fn type_name_of<T>(_: &T) -> &'static str {
|
|
||||||
std::any::type_name::<T>()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<(), Report> {
|
async fn main() -> Result<(), Report> {
|
||||||
setup()?;
|
setup()?;
|
||||||
info!("Building that fetch future...");
|
|
||||||
let client = Client::new();
|
let client = Client::new();
|
||||||
let fut = fetch_thing(&client, URL_1);
|
|
||||||
info!("Sleeping for a bit...");
|
let fut1 = fetch_thing(&client, URL_1);
|
||||||
sleep(Duration::from_secs(1)).await;
|
let fut2 = fetch_thing(&client, URL_2);
|
||||||
info!("Awaiting that fetch future...");
|
|
||||||
fut.await?;
|
fut1.await?;
|
||||||
info!("Done awaiting that fetch future");
|
fut2.await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user