Comment on Async/await support in FirefoxparentComments−mark2429y var txt = await read(); // This code is blocked until read() completes. console.log(txt);−kinkdr9yIt is in essence: read((err, txt) => { console.log(txt) }) Or read().then((txt) => console.log(txt)) Why is it bad?−danneu9yAwait doesn't synchronously block in Javascript.http://docs.scala-lang.org/overviews/core/futures.html#block...−olalonde9yAnd how do you suggest to do that without "blocking"? :) Sure, you could use a stream but that isn't always possible or practical.−solipsism9yThat's not what blocking means.−c-smile9yWell, it depends...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.−solipsism9yYes but when you talking about async/await, "blocking" means "blocking the thread". And this is very clearly what mehwoot meant.
Comments
It is in essence:
Or Why is it bad?Await doesn't synchronously block in Javascript.
http://docs.scala-lang.org/overviews/core/futures.html#block...
And how do you suggest to do that without "blocking"? :) Sure, you could use a stream but that isn't always possible or practical.
That's not what blocking means.
Well, it depends...
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.
Yes but when you talking about async/await, "blocking" means "blocking the thread". And this is very clearly what mehwoot meant.