3 ms·
For this specific case, just use traditional blocking functions: val another_path = readFileSync(path); val data = readFileSync(another_path); cons
by flohofwoe 3y ago
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 run while the blocking functions are "stuck". That's exactly what processes and threads had been invented for.