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

timers: introduce setInterval async iterator #35841

Closed
wants to merge 3 commits into from
Closed

timers: introduce setInterval async iterator #35841

wants to merge 3 commits into from

Commits on Dec 17, 2020

  1. timers: introduce setInterval async iterator

    Utilises Symbol.asyncIterator to provide an iterator compatible with `for await`
    
    ```
    const {
      setInterval
    } = require('timers/promises');
    
    const ac = new AbortController()
    const signal = ac.signal
    
    setTimeout(() => ac.abort(), 500)
    
    for await (const value of setInterval(interval, null, { ref: false, signal })) {
    
    }
    ```
    fabiancook committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    c6b436c View commit details
    Browse the repository at this point in the history
  2. fixup! timers: introduce setInterval async iterator

    Remove custom promisify from setInterval
    fabiancook committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    e5496f2 View commit details
    Browse the repository at this point in the history
  3. fixup! timers: introduce setInterval async iterator

    --- This is still WIP and I will replace this commit with more progress, currently waiting for the branch to build locally.. ---
    fabiancook committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    b71c61f View commit details
    Browse the repository at this point in the history