deno
ff932b41 - fix(core): poll async ops eagerly (#12385)

Commit
5 years ago
fix(core): poll async ops eagerly (#12385) Currently all async ops are polled lazily, which means that op initialization code is postponed until control is yielded to the event loop. This has some weird consequences, e.g. ```js let listener = Deno.listen(...); let conn_promise = listener.accept(); listener.close(); // `BadResource` is thrown. A reasonable error would be `Interrupted`. let conn = await conn_promise; ``` JavaScript promises are expected to be eagerly evaluated. This patch makes ops actually do that.
Author
Committer
Parents
Loading