From 83426be6eead06c680ae527468aeaf8723543ff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 2 Sep 2023 08:48:21 +0200 Subject: 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". --- ext/websocket/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ext/websocket') diff --git a/ext/websocket/lib.rs b/ext/websocket/lib.rs index 4b05131d9..32e2d18cc 100644 --- a/ext/websocket/lib.rs +++ b/ext/websocket/lib.rs @@ -5,6 +5,7 @@ use deno_core::error::invalid_hostname; use deno_core::error::type_error; use deno_core::error::AnyError; use deno_core::op; +use deno_core::op2; use deno_core::url; use deno_core::AsyncMutFuture; use deno_core::AsyncRefCell; @@ -528,12 +529,12 @@ pub async fn op_ws_send_ping( .await } -#[op(deferred)] +#[op2(async(lazy))] pub async fn op_ws_close( state: Rc>, - rid: ResourceId, + #[smi] rid: ResourceId, code: Option, - reason: Option, + #[string] reason: Option, ) -> Result<(), AnyError> { let resource = state .borrow_mut() -- cgit v1.2.3