I think it would be nice to have a lint that warns like this
async function doStuff() {
Deno.readTextFileSync("") // warning here: using a sync function inside an async function, this blocks deno event loop, you should consider changing it to an async function
}
Don't know how this stuff is implemented, but I imagine that sync function blocks tokio executor, so no other async function will proceed, here is an example program that showcases my assumption
setInterval(() => console.log(4), 1000);
//Deno.readTextFileSync("/dev/random"); // if this is uncommented, no logging will be printed
//await Deno.readTextFile("/dev/random"); // if this is uncommneted, logging will still work
I think it would be nice to have a lint that warns like this
Don't know how this stuff is implemented, but I imagine that sync function blocks tokio executor, so no other async function will proceed, here is an example program that showcases my assumption