How to do parallel file reads with async

Run parallel file reads in Rust by spawning async tasks with tokio::spawn and awaiting results with tokio::join.

Use tokio::spawn to run file reads concurrently and tokio::fs::read_to_string to perform non-blocking I/O.

use tokio::fs;

#[tokio::main]
async fn main() {
    let handle1 = tokio::spawn(async {
        fs::read_to_string("file1.txt").await.unwrap()
    });
    let handle2 = tokio::spawn(async {
        fs::read_to_string("file2.txt").await.unwrap()
    });
    let (content1, content2) = tokio::join!(handle1, handle2);
}