From 093b3eee58181ec45839d0fe10b8157326a102b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 25 Oct 2023 13:43:38 +0200 Subject: chore: update deno_core and port all remaining ops to `op2` (#20954) Signed-off-by: Matt Mastracci Co-authored-by: Matt Mastracci --- ext/websocket/lib.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'ext/websocket/lib.rs') diff --git a/ext/websocket/lib.rs b/ext/websocket/lib.rs index 48a22431b..83d553eeb 100644 --- a/ext/websocket/lib.rs +++ b/ext/websocket/lib.rs @@ -4,7 +4,6 @@ use bytes::Bytes; 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; @@ -472,11 +471,11 @@ pub fn op_ws_send_text( } /// Async version of send. Does not update buffered amount as we rely on the socket itself for backpressure. -#[op(fast)] +#[op2(async)] pub async fn op_ws_send_binary_async( state: Rc>, - rid: ResourceId, - data: JsBuffer, + #[smi] rid: ResourceId, + #[buffer] data: JsBuffer, ) -> Result<(), AnyError> { let resource = state .borrow_mut() @@ -490,11 +489,11 @@ pub async fn op_ws_send_binary_async( } /// Async version of send. Does not update buffered amount as we rely on the socket itself for backpressure. -#[op(fast)] +#[op2(async)] pub async fn op_ws_send_text_async( state: Rc>, - rid: ResourceId, - data: String, + #[smi] rid: ResourceId, + #[string] data: String, ) -> Result<(), AnyError> { let resource = state .borrow_mut() @@ -609,10 +608,10 @@ pub fn op_ws_get_error(state: &mut OpState, #[smi] rid: ResourceId) -> String { resource.error.take().unwrap_or_default() } -#[op(fast)] +#[op2(async)] pub async fn op_ws_next_event( state: Rc>, - rid: ResourceId, + #[smi] rid: ResourceId, ) -> u16 { let Ok(resource) = state .borrow_mut() -- cgit v1.2.3