Questions about the hyper1 client example

// Spawn a task to poll the connection, driving the HTTP state
tokio::task::spawn(async move {
    if let Err(err) = conn.await {
        println!("Connection failed: {:?}", err);
    }
});

What errors might this spawned thread generate? Should they be sent back to the main thread? If so, how should they be sent back?

The code is spawning a task, not a thread. Therefore, your following questions don't really apply.

I've gotten used to calling tasks threads. They serve a similar purpose, and the question still applies.

tokio::spawn() returns a JoinHandle that can you can .await to get the result . You can also use async channels to send the errors elsewhere out of the task (oneshot channel).

However, I'd avoid spawning completely and use:

try_join!(conn, async { rest of the code })

which will poll both futures without having to spawn.