diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-10-25 13:43:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-25 13:43:38 +0200 |
commit | 093b3eee58181ec45839d0fe10b8157326a102b2 (patch) | |
tree | 33f1cb35bfef7a85335d46ca7cb055459c20d637 /ext/websocket/lib.rs | |
parent | 6c60859407a39e579a9f7101b254c874af85ca68 (diff) |
chore: update deno_core and port all remaining ops to `op2` (#20954)
Signed-off-by: Matt Mastracci <matthew@mastracci.com>
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
Diffstat (limited to 'ext/websocket/lib.rs')
-rw-r--r-- | ext/websocket/lib.rs | 17 |
1 files changed, 8 insertions, 9 deletions
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<RefCell<OpState>>, - 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<RefCell<OpState>>, - 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<RefCell<OpState>>, - rid: ResourceId, + #[smi] rid: ResourceId, ) -> u16 { let Ok(resource) = state .borrow_mut() |