summaryrefslogtreecommitdiff
path: root/ext/web/timers.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-10-25 13:43:38 +0200
committerGitHub <noreply@github.com>2023-10-25 13:43:38 +0200
commit093b3eee58181ec45839d0fe10b8157326a102b2 (patch)
tree33f1cb35bfef7a85335d46ca7cb055459c20d637 /ext/web/timers.rs
parent6c60859407a39e579a9f7101b254c874af85ca68 (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/web/timers.rs')
-rw-r--r--ext/web/timers.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/web/timers.rs b/ext/web/timers.rs
index 67beee599..7c83e8f37 100644
--- a/ext/web/timers.rs
+++ b/ext/web/timers.rs
@@ -4,7 +4,6 @@
use crate::hr_timer_lock::hr_timer_lock;
use deno_core::error::AnyError;
-use deno_core::op;
use deno_core::op2;
use deno_core::CancelFuture;
use deno_core::CancelHandle;
@@ -80,11 +79,11 @@ pub fn op_timer_handle(state: &mut OpState) -> ResourceId {
/// [`TimerHandle`] resource given by `rid` has been canceled.
///
/// If the timer is canceled, this returns `false`. Otherwise, it returns `true`.
-#[op(deferred)]
+#[op2(async(deferred), fast)]
pub async fn op_sleep(
state: Rc<RefCell<OpState>>,
- millis: u64,
- rid: ResourceId,
+ #[number] millis: u64,
+ #[smi] rid: ResourceId,
) -> Result<bool, AnyError> {
let handle = state.borrow().resource_table.get::<TimerHandle>(rid)?;