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

move away from process.nextTick #51114

Closed
wants to merge 1 commit into from
Closed

Commits on Dec 11, 2023

  1. move away from process.nextTick

    There are two problems with process.nextTick.
    
    Less severe is that it reduces performance for
    all async callback from native code.
    
    The more severe one is that it causes weird and
    unpredictable behavior when trying to interop
    with promises and async/await code.
    
    In particular, we have an invariant where we always
    emit certain events and invoke certain callbacks
    "asynchronously". However, that currently doesn't
    apply to Promise, since we "force" asynchronousity
    throug process.nextTick which occurs before any
    microtick. Hence, for any promise/micro-tick based
    code things actually appear to occur synchronously.
    
    Refs: nodejs#51070
    PR: nodejs#51114
    ronag committed Dec 11, 2023
    Configuration menu
    Copy the full SHA
    8ce0fe3 View commit details
    Browse the repository at this point in the history