Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: implement setTimeout, setInterval, clearTimeout, and clearInterval #293

Merged
merged 6 commits into from Nov 24, 2022

Conversation

JakeChampion
Copy link
Contributor

@JakeChampion JakeChampion commented Oct 19, 2022

Using the new fastly_async_io module we can implement JS timers 🥳

This pull-request implements setTimeout, setInterval, clearTimeout, and clearInterval and adds some interface and basic tests for them. There are also tests in the web-platform-tests that exercise the functions fully, which is why I only needed to write some basic tests.

Currently Viceroy does not have a host implementation for fastly_async_io so for now our tests can only run in production.

Closes #63

@JakeChampion JakeChampion force-pushed the jake/generic-select branch 3 times, most recently from 6b544fe to 7de0b1a Compare October 19, 2022 17:37
Copy link
Contributor

@elliottt elliottt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! I haven't had to use chrono much, so this was fun to read through :D

c-dependencies/js-compute-runtime/js-compute-builtins.cpp Outdated Show resolved Hide resolved
c-dependencies/js-compute-runtime/js-compute-builtins.cpp Outdated Show resolved Hide resolved
c-dependencies/js-compute-runtime/js-compute-builtins.cpp Outdated Show resolved Hide resolved
c-dependencies/js-compute-runtime/js-compute-builtins.cpp Outdated Show resolved Hide resolved
c-dependencies/js-compute-runtime/js-compute-builtins.cpp Outdated Show resolved Hide resolved
c-dependencies/js-compute-runtime/js-compute-builtins.cpp Outdated Show resolved Hide resolved
@JakeChampion JakeChampion force-pushed the jake/generic-select branch 8 times, most recently from 874a89e to 63aa466 Compare October 27, 2022 15:49
@JakeChampion
Copy link
Contributor Author

@elliottt this is ready for another rounds of reviews -- I also used the version of Viceroy which has implementations for the fastly_async_io module so that I could update our web-platform-test results -- it's so good to see them all passing ☺️

Copy link
Contributor

@elliottt elliottt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!

@JakeChampion JakeChampion force-pushed the jake/generic-select branch 3 times, most recently from 7550146 to b079f76 Compare October 28, 2022 11:13
@JakeChampion
Copy link
Contributor Author

This is currently blocked on a new version of Viceroy which includes the fastly_async_io module -- fastly/Viceroy#188

Once that pull-request is merged and released, we can update our version of Viceroy and should then see all the tests pass on this PR 👍

dependabot bot and others added 6 commits November 24, 2022 11:22
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.65 to 1.0.66.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](dtolnay/anyhow@1.0.65...1.0.66)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Trevor Elliott <telliott@fastly.com>
Co-authored-by: Trevor Elliott <telliott@fastly.com>
…mers` is not empty before calling `repeat_first`
@JakeChampion JakeChampion deleted the jake/generic-select branch November 24, 2022 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setTimeout support?
2 participants