summaryrefslogtreecommitdiff
path: root/runtime/ops/web_worker.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-09-02 08:48:21 +0200
committerGitHub <noreply@github.com>2023-09-02 08:48:21 +0200
commit83426be6eead06c680ae527468aeaf8723543ff2 (patch)
tree322c6659e366c8bf6029cd7082d10947d7dca9b5 /runtime/ops/web_worker.rs
parente1fb48524d2730bf7c7dfaf021bf39de2d5903bb (diff)
refactor: rewrite ops that use 'deferred' to use 'op2(async(lazy))' (#20303)
Rewrites 3 ops that used "op(deferred)" to use "op2(async(lazy))" instead. This will allow us to remove codepath for handling "deferred" ops in "deno_core".
Diffstat (limited to 'runtime/ops/web_worker.rs')
-rw-r--r--runtime/ops/web_worker.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/ops/web_worker.rs b/runtime/ops/web_worker.rs
index e62642fdd..b7b16ec1d 100644
--- a/runtime/ops/web_worker.rs
+++ b/runtime/ops/web_worker.rs
@@ -6,6 +6,7 @@ use crate::web_worker::WebWorkerInternalHandle;
use crate::web_worker::WebWorkerType;
use deno_core::error::AnyError;
use deno_core::op;
+use deno_core::op2;
use deno_core::CancelFuture;
use deno_core::OpState;
@@ -37,7 +38,8 @@ fn op_worker_post_message(
Ok(())
}
-#[op(deferred)]
+#[op2(async(lazy))]
+#[serde]
async fn op_worker_recv_message(
state: Rc<RefCell<OpState>>,
) -> Result<Option<JsMessageData>, AnyError> {