struct Timeout;

async fn test(timeout, helpful_hint) {
    let request = http::get(`http://httpstat.us/200?sleep=${timeout}`);
    let timeout = time::sleep(time::Duration::from_secs(2));

    let result = select {
        _ = timeout => Err(Timeout),
        res = request => res,
    }?;

    Ok((result.text().await?, helpful_hint))
}

let a = test(1000, "first call");
let b = test(5000, "second call");

loop {
    let res = select {
        res = a => res,
        res = b => res,
    };

    match res {
        () => break,
        Ok((text, helpful_hint)) => {
            println!("{text}: {helpful_hint}");
        }
        Err(Timeout) => {
            println!("request timed out");
        }
    }
}
