Skip to content

Commit

Permalink
refactor(timers): Refactor timers to use one async op per timer
Browse files Browse the repository at this point in the history
This change also makes the timers implementation closer to the spec, and
sets up the stage to implement `AbortSignal.timeout()`
(whatwg/dom#1032).

Fixes #8965.
Fixes #10974.
Fixes #11398.
  • Loading branch information
Andreu Botella committed Nov 28, 2021
1 parent 96d02de commit 0b69692
Show file tree
Hide file tree
Showing 4 changed files with 256 additions and 593 deletions.
10 changes: 5 additions & 5 deletions cli/tests/testdata/test/ops_sanitizer_unstable.out
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ Before:
- dispatched: 1
- completed: 1
After:
- dispatched: 3
- completed: 2
- dispatched: 4
- completed: 3
Ops:
op_global_timer:
op_sleep:
Before:
- dispatched: 1
- completed: 1
After:
- dispatched: 3
- completed: 2
- dispatched: 4
- completed: 3

Make sure to await all promises returned from Deno APIs before
finishing test case.
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/worker_drop_handle_race.js.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error: Uncaught (in worker "") Error
throw new Error();
^
at [WILDCARD]/workers/drop_handle_race.js:2:9
at fire (deno:ext/timers/[WILDCARD])
at Object.action (deno:ext/timers/[WILDCARD])
at handleTimerMacrotask (deno:ext/timers/[WILDCARD])
error: Uncaught (in promise) Error: Unhandled error event in child worker.
at Worker.#pollControl (deno:runtime/js/11_workers.js:[WILDCARD])
Loading

0 comments on commit 0b69692

Please sign in to comment.