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

Get timers working in Rust rewrite #413

Closed
ry opened this issue Jul 26, 2018 · 3 comments
Closed

Get timers working in Rust rewrite #413

ry opened this issue Jul 26, 2018 · 3 comments

Comments

@ry
Copy link
Member

ry commented Jul 26, 2018

Using Tokio

@ry ry added this to the v0.1 (first binary release) milestone Jul 26, 2018
@benjamingr
Copy link
Contributor

As an idea - we can ship timers that are awaitable out of the box.

We can implement Symbol.asyncIterator on setInterval and then on setTimeout directly.

Cons:

  • Isn't what browsers do

Pros:

  • Much nicer API for use with async/await

@ry
Copy link
Member Author

ry commented Jul 30, 2018

@benjamingr is there a spec for that? We've used await delay(milliseconds) in the past.

We have to provide setTimeout and friends in any case, but I'm not opposed to having delay (or whatever is standard).

@benjamingr
Copy link
Contributor

@ry there is no standard for that as far as I know - just half-baked proposals and discussions in the Node.js repo and whatwg list.

Node also provides a util.promisify compatible setTimeout which basically does delay.

@ry ry closed this as completed in #434 Aug 9, 2018
piscisaureus pushed a commit to piscisaureus/deno that referenced this issue Oct 7, 2019
hardfist pushed a commit to hardfist/deno that referenced this issue Aug 7, 2024
Bumped versions for 0.243.0

Please ensure:
- [ ] Crate versions are bumped correctly
To make edits to this PR:
```shell
git fetch upstream release_0_243.0 && git checkout -b release_0_243.0 upstream/release_0_243.0
```

cc @mmastrac

Co-authored-by: mmastrac <[email protected]>
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

No branches or pull requests

2 participants