process: deprecate _getActive* private APIs in favour of async_hooks#40804
process: deprecate _getActive* private APIs in favour of async_hooks#40804RaisinTen wants to merge 1 commit intonodejs:masterfrom
_getActive* private APIs in favour of async_hooks#40804Conversation
20336e2 to
82fe642
Compare
|
We probably need a runtime deprecation first, right? |
The `process._getActiveRequests()` and `process._getActiveHandles()` functions are not needed anymore because the `async_hooks` module already provides functionality that helps us to keep a track of the active resources. Signed-off-by: Darshan Sen <darshan.sen@postman.com>
82fe642 to
bcf7c12
Compare
_getActive* functions in favour of async_hooks_getActive* private APIs in favour of async_hooks
|
Don't you need to set up various async hooks in advance to be able to achieve the same thing? Additionally as far as I'm aware, using Also even though these functions are "private", I have a feeling this could cause a lot of breakage in the ecosystem. |
|
I agree with @mscdex. |
| const NUM = 8; | ||
| const connections = []; | ||
| const clients = []; | ||
| let clients_counter = 0; |
There was a problem hiding this comment.
I think we should leave the actual test in place since we're not removing these APIs yet.
Are you talking about the overhead incurred for this hook creation in particular or any Lines 258 to 266 in cf56abe If ^, I think we can get rid of that one in #40810.
If we make it public, which exact module/object should we expose this from? |
|
Still too early to deprecate. There are some valid uses of the underlying handles that hasn't been addressed yet. (see #40813 (comment) for some uses in public GH repos) |
The
process._getActiveRequests()andprocess._getActiveHandles()functions are not needed anymore because the
async_hooksmodulealready provides functionality that helps us to keep a track of the
active resources.
Signed-off-by: Darshan Sen darshan.sen@postman.com