-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
process: make getActive{Handles,Requests} official #18844
Conversation
process._getActiveHandles() and process._getActiveRequests() have been around for a long time, and utilized to a large enough degree that it makes sense to make them official APIs.
Generally +1 to this. One thing that’s worth noting is that And similarly for requests, we may want to make sure that what we return is actually public API… |
Random observation: there's no |
|
||
```js | ||
console.log(`Active handles: ${util.inspect(process.getActiveHandles())}`); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More information about the things that are in the array would be helpful. What kind of objects are they? What can the user basically do with them, ec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, util.inspect
ing them and then console.log
ing does not seem to be a good example since console.log
will util.inspect
them anyway..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to know which active handles are open for a particular process id. How can I get it
@@ -298,6 +298,8 @@ | |||
|
|||
function setupProcessObject() { | |||
process._setupProcessObject(pushValueToArray); | |||
process._getActiveHandles = process.getActiveHandles; | |||
process._getActiveRequests = process.getActiveRequests; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this include some form of deprecation for the _
-prefixed versions?
I think we should put in the work to return the actual Timer instances for these. @cjihrig Btw, I know I'm asking for a lot of things in this PR -- I'd totally be willing to help make those happen, if you want help with anything. |
I'm wondering also if these should not be moved to the |
Ping @cjihrig |
Ping @cjihrig again |
Closing due to no response. @cjihrig please reopen or open a new PR when you plan on working on this again. |
Hello! Thanks for NodeJS, it’s an incredible language. This feature would be nice, so I’m kindly asking if by any chance tho PR could be revised, fixed and merged by a good soul. I was willing to use the function, but my spider sense always freaks out in front of If this PR is dead, would they be any way to get it back on ? Is there any way one could contribute ? I would love to help but never contributed to NodeJS before, it might be more painful to help me get it right =( Thanks ! |
@gpotter2 feel free to give it a try. You could go ahead and cherry-pick this commit and then add your code on top of that. You'll get feedback and help how to get there. Just ask for things explicitly if you need any help. |
process._getActiveHandles()
andprocess._getActiveRequests()
have been around for a long time, and are utilized to a large enough degree that it makes sense to make them officialAPIs.
If this PR is accepted, I'll submit a follow up that deprecates the underscore prefixed versions.
Fixes: #1128
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
process