diff options
author | Bert Belder <bertbelder@gmail.com> | 2021-10-09 22:37:19 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2021-10-17 19:50:42 +0200 |
commit | ff932b411d63269dbd4d30ea6bd0aa5160fd8aff (patch) | |
tree | 5dad617aea815c4145262860d6e3b5115224ab92 /core/lib.rs | |
parent | ff95fc167d7124f3c7f2c6951070e2c40701cf32 (diff) |
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.
Diffstat (limited to 'core/lib.rs')
-rw-r--r-- | core/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/lib.rs b/core/lib.rs index ea7b322e2..c0419f8ab 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -68,6 +68,7 @@ pub use crate::normalize_path::normalize_path; pub use crate::ops::serialize_op_result; pub use crate::ops::Op; pub use crate::ops::OpAsyncFuture; +pub use crate::ops::OpCall; pub use crate::ops::OpFn; pub use crate::ops::OpId; pub use crate::ops::OpPayload; |