var txt = await read();
// This code is blocked until read() completes.
console.log(txt); var txt = await read();
// This code is blocked until read() completes.
console.log(txt); read((err, txt) => {
console.log(txt)
})
Or read().then((txt) => console.log(txt))
Why is it bad?http://docs.scala-lang.org/overviews/core/futures.html#block...
async function is blocked on await statement, after all that's why it has such a name.
It does not block the whole VM but task (async function) is effectively blocked for an observer inside it.