@@ -140,9 +140,9 @@ destructor calls are emulated.
140
140
141
141
##### ` init(id, type, triggerId, resource) `
142
142
143
- * ` id ` {Number } a unique id for the async resource
143
+ * ` id ` {number } a unique id for the async resource
144
144
* ` type ` {String} the type of the async resource
145
- * ` triggerId ` {Number } the unique id of the async resource in whose
145
+ * ` triggerId ` {number } the unique id of the async resource in whose
146
146
execution context this async resource was created
147
147
* ` resource ` {Object} reference to the resource representing the async operation,
148
148
needs to be released during _ destroy_
@@ -289,7 +289,7 @@ the **why** use `triggerId`.
289
289
290
290
##### ` before(id) `
291
291
292
- * ` id ` {Number }
292
+ * ` id ` {number }
293
293
294
294
When an asynchronous operation is triggered (such as a TCP server receiving a
295
295
new connection) or completes (such as writing data to disk) a callback is
@@ -303,7 +303,7 @@ and exactly 1 time if the resource is a request.
303
303
304
304
##### ` after(id) `
305
305
306
- * ` id ` {Number }
306
+ * ` id ` {number }
307
307
308
308
Called immediately after the callback specified in ` before() ` is completed. If
309
309
an uncaught exception occurs during execution of the callback then ` after() `
@@ -312,7 +312,7 @@ will run after the `'uncaughtException'` event or a `domain`'s handler runs.
312
312
313
313
##### ` destroy(id) `
314
314
315
- * ` id ` {Number }
315
+ * ` id ` {number }
316
316
317
317
Called either when the class destructor is run or if the resource is manually
318
318
marked as free. For core C++ classes that have a destructor the callback will
@@ -330,7 +330,7 @@ the resource doesn't depend on GC then this isn't an issue.
330
330
331
331
#### ` async_hooks.currentId() `
332
332
333
- * Returns {Number } the ` id ` of the current execution context. Useful to track when
333
+ * Returns {number } the ` id ` of the current execution context. Useful to track when
334
334
something fires.
335
335
336
336
For example:
@@ -362,7 +362,7 @@ const server = net.createServer(function onconnection(conn) {
362
362
363
363
#### ` async_hooks.triggerId() `
364
364
365
- * Returns {Number } the id of the resource responsible for calling the callback
365
+ * Returns {number } the id of the resource responsible for calling the callback
366
366
that is currently being executed.
367
367
368
368
For example:
@@ -425,7 +425,7 @@ asyncEvent.triggerId();
425
425
426
426
* arguments
427
427
* ` type ` {String} the type of ascycn event
428
- * ` triggerId ` {Number } the id of the execution context that created this async
428
+ * ` triggerId ` {number } the id of the execution context that created this async
429
429
event
430
430
* Returns {AsyncEvent} A reference to ` asyncHook ` .
431
431
@@ -483,13 +483,13 @@ never be called.
483
483
484
484
#### ` asyncEvent.asyncId() `
485
485
486
- * Returns {Number } the unique ` id ` assigned to the resource.
486
+ * Returns {number } the unique ` id ` assigned to the resource.
487
487
488
488
Useful when used with ` triggerIdScope() ` .
489
489
490
490
#### ` asyncEvent.triggerId() `
491
491
492
- * Returns {Number } the same ` triggerId ` that is passed to ` init() ` hooks.
492
+ * Returns {number } the same ` triggerId ` that is passed to ` init() ` hooks.
493
493
494
494
### Standalone JS API
495
495
@@ -529,7 +529,7 @@ async_hooks.emitDestroy(id);
529
529
530
530
#### ` async_hooks.newId() `
531
531
532
- * Returns {Number } a new unique ` id ` meant for a newly created asynchronous resource.
532
+ * Returns {number } a new unique ` id ` meant for a newly created asynchronous resource.
533
533
534
534
The value returned will never be assigned to another resource.
535
535
@@ -546,7 +546,7 @@ class MyClass {
546
546
547
547
#### ` async_hooks.initTriggerId() `
548
548
549
- * Returns {Number }
549
+ * Returns {number }
550
550
551
551
There are several ways to set the ` triggerId ` for an instantiated resource.
552
552
This API is how that value is retrieved. It returns the ` id ` of the resource
@@ -555,9 +555,9 @@ responsible for the newly created resource being instantiated. For example:
555
555
556
556
#### ` async_hooks.emitInit(id, type[, triggerId][, resource]) `
557
557
558
- * ` id ` {Number } Generated by calling ` newId() `
558
+ * ` id ` {number } Generated by calling ` newId() `
559
559
* ` type ` {String}
560
- * ` triggerId ` {Number } ** Default:** ` currentId() `
560
+ * ` triggerId ` {number } ** Default:** ` currentId() `
561
561
* ` resource ` {Object}
562
562
* Returns {Undefined}
563
563
@@ -583,8 +583,8 @@ constructor.
583
583
584
584
#### ` async_hooks.emitBefore(id[, triggerId]) `
585
585
586
- * ` id ` {Number } Generated by ` newId() `
587
- * ` triggerId ` {Number }
586
+ * ` id ` {number } Generated by ` newId() `
587
+ * ` triggerId ` {number }
588
588
* Returns {Undefined}
589
589
590
590
Notify ` before() ` hooks that the resource is about to enter its execution call
@@ -609,7 +609,7 @@ MyThing.prototype.done = function done() {
609
609
610
610
#### ` async_hooks.emitAfter(id) `
611
611
612
- * ` id ` {Number } Generated by ` newId() `
612
+ * ` id ` {number } Generated by ` newId() `
613
613
* Returns {Undefined}
614
614
615
615
Notify ` after() ` hooks that the resource is exiting its execution call stack.
@@ -635,15 +635,15 @@ fatal exception handler.
635
635
636
636
#### ` async_hooks.emitDestroy(id) `
637
637
638
- * ` id ` {Number } Generated by ` newId() `
638
+ * ` id ` {number } Generated by ` newId() `
639
639
* Returns {Undefined}
640
640
641
641
Notify hooks that a resource is being destroyed (or being moved to the free'd
642
642
resource pool).
643
643
644
644
#### ` async_hooks.triggerIdScope(triggerId, callback) `
645
645
646
- * ` triggerId ` {Number }
646
+ * ` triggerId ` {number }
647
647
* ` callback ` {Function}
648
648
* Returns {Undefined}
649
649
0 commit comments