Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/api/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,12 @@ register('./my-hooks.mjs', {
});
```

A hook can send messages to the thread that registered it at any time, as
above. It must not wait for a reply while it is running: resolution and loading
are synchronous from the perspective of the thread that triggered them, so that
thread is blocked until the hook settles and cannot answer in the meantime.
Awaiting a reply inside a `resolve` or `load` hook deadlocks both threads.

#### Asynchronous hooks accepted by `module.register()`

<!-- YAML
Expand Down
Loading