News for hackers. Stuff that matters.
Re:How to think about `async`/`await` in Rust by flohofwoe on Wednesday July 05, 2023 @04:47AM (#36597604)
For this specific case, just use traditional blocking functions:

    val another_path = readFileSync(path);
    val data = readFileSync(another_path);
    console.log(data.length);
The "runtime" (for instance the OS, or a task system) will take care of scheduling other things that are ready to to run while the the blocking functions are "stuck". That's exactly what processes and threads had been invented for.

There are no comments on this comment yet.