阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js async_hooks 钩子回调 promiseResolve

      Node.js async_hooks 钩子回调 promiseResolve

      asyncId < number>

      Called when the resolve function passed to the Promise constructor is invoked (either directly or through other means of resolving a promise).

      Note that resolve() does not do any observable synchronous work.

      The Promise is not necessarily fulfilled or rejected at this point if the Promise was resolved by assuming the state of another Promise.

      new Promise((resolve) => resolve(true)).then((a) => {});
      

      calls the following callbacks:

      init for PROMISE with id 5, trigger id: 1
        promise resolve 5      # corresponds to resolve(true)
      init for PROMISE with id 6, trigger id: 5  # the Promise returned by then()
        before 6               # the then() callback is entered
        promise resolve 6      # the then() callback resolves the promise by returning
        after 6
      

      更多选项请参考:Node.js 异步钩子,或者通过 点击对应菜单 进行查看;


      目录
      本文目录
      目录