@@ -79,12 +79,12 @@ function promiseResolve(asyncId) { }
79
79
added: v8.1.0
80
80
-->
81
81
82
- * ` callbacks ` {Object} the [ Hook Callbacks] [ ] to register
82
+ * ` callbacks ` {Object} The [ Hook Callbacks] [ ] to register
83
83
* ` init ` {Function} The [ ` init ` callback] [ ] .
84
84
* ` before ` {Function} The [ ` before ` callback] [ ] .
85
85
* ` after ` {Function} The [ ` after ` callback] [ ] .
86
86
* ` destroy ` {Function} The [ ` destroy ` callback] [ ] .
87
- * Returns: ` {AsyncHook} ` instance used for disabling and enabling hooks
87
+ * Returns: ` {AsyncHook} ` Instance used for disabling and enabling hooks
88
88
89
89
Registers functions to be called for different lifetime events of each async
90
90
operation.
@@ -168,7 +168,7 @@ doing this the otherwise infinite recursion is broken.
168
168
169
169
#### ` asyncHook.enable() `
170
170
171
- * Returns {AsyncHook} A reference to ` asyncHook ` .
171
+ * Returns: {AsyncHook} A reference to ` asyncHook ` .
172
172
173
173
Enable the callbacks for a given ` AsyncHook ` instance. If no callbacks are
174
174
provided enabling is a noop.
@@ -184,7 +184,7 @@ const hook = async_hooks.createHook(callbacks).enable();
184
184
185
185
#### ` asyncHook.disable() `
186
186
187
- * Returns {AsyncHook} A reference to ` asyncHook ` .
187
+ * Returns: {AsyncHook} A reference to ` asyncHook ` .
188
188
189
189
Disable the callbacks for a given ` AsyncHook ` instance from the global pool of
190
190
AsyncHook callbacks to be executed. Once a hook has been disabled it will not
@@ -200,12 +200,12 @@ instance is destructed.
200
200
201
201
##### ` init(asyncId, type, triggerAsyncId, resource) `
202
202
203
- * ` asyncId ` {number} a unique ID for the async resource
204
- * ` type ` {string} the type of the async resource
205
- * ` triggerAsyncId ` {number} the unique ID of the async resource in whose
206
- execution context this async resource was created
207
- * ` resource ` {Object} reference to the resource representing the async operation,
208
- needs to be released during _ destroy_
203
+ * ` asyncId ` {number} A unique ID for the async resource.
204
+ * ` type ` {string} The type of the async resource.
205
+ * ` triggerAsyncId ` {number} The unique ID of the async resource in whose
206
+ execution context this async resource was created.
207
+ * ` resource ` {Object} Reference to the resource representing the async operation,
208
+ needs to be released during _ destroy_ .
209
209
210
210
Called when a class is constructed that has the _ possibility_ to emit an
211
211
asynchronous event. This _ does not_ mean the instance must call
@@ -468,7 +468,7 @@ init for PROMISE with id 6, trigger id: 5 # the Promise returned by then()
468
468
469
469
#### ` async_hooks.executionAsyncId() `
470
470
471
- * Returns {number} the ` asyncId ` of the current execution context. Useful to
471
+ * Returns: {number} The ` asyncId ` of the current execution context. Useful to
472
472
track when something calls.
473
473
474
474
For example:
@@ -502,7 +502,7 @@ const server = net.createServer(function onConnection(conn) {
502
502
503
503
#### ` async_hooks.triggerAsyncId() `
504
504
505
- * Returns {number} the ID of the resource responsible for calling the callback
505
+ * Returns: {number} The ID of the resource responsible for calling the callback
506
506
that is currently being executed.
507
507
508
508
For example:
@@ -569,9 +569,9 @@ asyncResource.triggerAsyncId();
569
569
#### ` AsyncResource(type[, triggerAsyncId]) `
570
570
571
571
* arguments
572
- * ` type ` {string} the type of async event
573
- * ` triggerAsyncId ` {number} the ID of the execution context that created this
574
- async event
572
+ * ` type ` {string} The type of async event.
573
+ * ` triggerAsyncId ` {number} The ID of the execution context that created this
574
+ async event.
575
575
576
576
Example usage:
577
577
@@ -599,15 +599,15 @@ class DBQuery extends AsyncResource {
599
599
600
600
#### ` asyncResource.emitBefore() `
601
601
602
- * Returns {undefined}
602
+ * Returns: {undefined}
603
603
604
604
Call all ` before ` callbacks to notify that a new asynchronous execution context
605
605
is being entered. If nested calls to ` emitBefore() ` are made, the stack of
606
606
` asyncId ` s will be tracked and properly unwound.
607
607
608
608
#### ` asyncResource.emitAfter() `
609
609
610
- * Returns {undefined}
610
+ * Returns: {undefined}
611
611
612
612
Call all ` after ` callbacks. If nested calls to ` emitBefore() ` were made, then
613
613
make sure the stack is unwound properly. Otherwise an error will be thrown.
@@ -618,7 +618,7 @@ called for all `asyncId`s on the stack if the error is handled by a domain or
618
618
619
619
#### ` asyncResource.emitDestroy() `
620
620
621
- * Returns {undefined}
621
+ * Returns: {undefined}
622
622
623
623
Call all ` destroy ` hooks. This should only ever be called once. An error will
624
624
be thrown if it is called more than once. This ** must** be manually called. If
@@ -627,11 +627,11 @@ never be called.
627
627
628
628
#### ` asyncResource.asyncId() `
629
629
630
- * Returns {number} the unique ` asyncId ` assigned to the resource.
630
+ * Returns: {number} The unique ` asyncId ` assigned to the resource.
631
631
632
632
#### ` asyncResource.triggerAsyncId() `
633
633
634
- * Returns {number} the same ` triggerAsyncId ` that is passed to the ` AsyncResource `
634
+ * Returns: {number} The same ` triggerAsyncId ` that is passed to the ` AsyncResource `
635
635
constructor.
636
636
637
637
[ `after` callback ] : #async_hooks_after_asyncid
0 commit comments