diff options
| author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-09-06 23:08:37 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-06 23:08:37 +0530 |
| commit | d2a408f452db1157a1e6a14810bd1f03fc431d9d (patch) | |
| tree | 66c45829a78cb3c6cd6e875cca65ce26384fe50d /ext | |
| parent | c0a684c14ed70717e18b528bb8f366eb593636a7 (diff) | |
perf(runtime): short-circuit `queue_async_op` for Poll::Ready (#15773)
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/web/timers.rs | 2 | ||||
| -rw-r--r-- | ext/websocket/lib.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/web/timers.rs b/ext/web/timers.rs index d9ceef875..f6b2cc9e7 100644 --- a/ext/web/timers.rs +++ b/ext/web/timers.rs @@ -93,7 +93,7 @@ pub fn op_timer_handle(state: &mut OpState) -> ResourceId { /// Waits asynchronously until either `millis` milliseconds have passed or the /// [`TimerHandle`] resource given by `rid` has been canceled. -#[op] +#[op(deferred)] pub async fn op_sleep( state: Rc<RefCell<OpState>>, millis: u64, diff --git a/ext/websocket/lib.rs b/ext/websocket/lib.rs index 515f798ac..fad217585 100644 --- a/ext/websocket/lib.rs +++ b/ext/websocket/lib.rs @@ -420,7 +420,7 @@ pub async fn op_ws_send( Ok(()) } -#[op] +#[op(deferred)] pub async fn op_ws_close( state: Rc<RefCell<OpState>>, rid: ResourceId, |
