Skip to content
Merged
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
7 changes: 7 additions & 0 deletions doc/api/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,13 @@ register('./my-hooks.mjs', {
});
```

A hook can send messages to the thread that registered it at any time, as
above. It must not block on a reply from that thread: 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.
Hooks can otherwise be fully asynchronous; it is only a reply over this
message channel that cannot be awaited.

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

<!-- YAML
Expand Down
Loading