Skip to content

Commit

Permalink
doc: fix minor issues in async_hooks.md
Browse files Browse the repository at this point in the history
* easily -> easy
* was -> is
* add a missing comma

PR-URL: #19313
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
Trott authored and BethGriggs committed Oct 17, 2018
1 parent 5b9af6e commit 9446bb6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions doc/api/async_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ unintentional side effects.
Because printing to the console is an asynchronous operation, `console.log()`
will cause the AsyncHooks callbacks to be called. Using `console.log()` or
similar asynchronous operations inside an AsyncHooks callback function will thus
cause an infinite recursion. An easily solution to this when debugging is
to use a synchronous logging operation such as `fs.writeSync(1, msg)`. This
will print to stdout because `1` is the file descriptor for stdout and will
not invoke AsyncHooks recursively because it is synchronous.
cause an infinite recursion. An easy solution to this when debugging is to use a
synchronous logging operation such as `fs.writeSync(1, msg)`. This will print to
stdout because `1` is the file descriptor for stdout and will not invoke
AsyncHooks recursively because it is synchronous.

```js
const fs = require('fs');
Expand Down Expand Up @@ -593,8 +593,8 @@ JavaScript API so that all the appropriate callbacks are called.

### `class AsyncResource()`

The class `AsyncResource` was designed to be extended by the embedder's async
resources. Using this users can easily trigger the lifetime events of their
The class `AsyncResource` is designed to be extended by the embedder's async
resources. Using this, users can easily trigger the lifetime events of their
own resources.

The `init` hook will trigger when an `AsyncResource` is instantiated.
Expand Down

0 comments on commit 9446bb6

Please sign in to comment.