This repository has been archived by the owner on Jul 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Intuitively the "parentId" of a given execution scope would be the "currentId" of the execution scope that created the handle that's currently executing. Using the formal definition for trigger "cause (an event or situation) to happen or exist", the "triggerId" is the id of the handle responsible for init() being called. For example: const server = net.createServer(conn => { // currentId() returns the id of the handle that's executing // the callback. In this case it's the id of "server". async_hooks.currentId(); // Though the handle that caused (or triggered) this callback to // be called was that of the new connection. Thus the return value // of triggerId() is the id of "conn". async_hooks.triggerId(); }).listen(); Add async_hooks.triggerId() API to return the trigger id responsible for the current execution scope.
- Loading branch information
1 parent
48d9c0b
commit 5e8bb63
Showing
1 changed file
with
53 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters