Skip to content

Conversation

legendecas
Copy link
Member

@legendecas legendecas commented Mar 20, 2020

Add a new async_hooks.aliveResources() API. Returns an object map
of { <id>: <resource> }.

This API exposes AsyncWrap#resource but not AsyncWrap#owner.

  • Collect N-API async contexts.
  • Some AsyncWrap#resources are not the public API object. We shall expose these public ones instead.

Co-Author: Jeremiah Senkpiel [email protected]

This PR is a pick up of #21453.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Mar 20, 2020
@legendecas legendecas added the async_hooks Issues and PRs related to the async hooks subsystem. label Mar 20, 2020
@addaleax
Copy link
Member

I’m not sure that this should end up under async_hooks – it doesn’t really list the resources in the sense of async_hooks, and that naming might be misleading.

@addaleax addaleax added the wip Issues and PRs that are still a work in progress. label Mar 29, 2020
Add a new async_hooks.aliveResources() API. Returns an object map
of { <id>: <resource> }. Currently, it works for all async_hooks
resources except nextTick-s, which are probably not useful to expose
in this way.

Co-Author: Jeremiah Senkpiel <[email protected]>
@legendecas
Copy link
Member Author

@addaleax Can you elaborate on why this isn't expected to list the resources in the sense of async_hooks? AFAIK, these resources are the ones passed to the init hooks.

@legendecas legendecas changed the title async_hooks: add async_hooks.activeResources async_hooks: add a method to expose all resources alive Apr 6, 2020
@BridgeAR BridgeAR force-pushed the master branch 2 times, most recently from 8ae28ff to 2935f72 Compare May 31, 2020 12:18
@legendecas legendecas closed this Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

async_hooks Issues and PRs related to the async hooks subsystem. lib / src Issues and PRs related to general changes in the lib or src directory. wip Issues and PRs that are still a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants