Skip to content

Commit

Permalink
docs(xsnap): document XS handleCommand async idiom
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Jan 23, 2021
1 parent 34ea0d2 commit 358a49e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/xsnap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ The parent and child communicate using "commands".
and receive as response from the Node.js parent.
- The XS child can implement a synchronous `handleCommand` function to respond
to commands from the Node.js parent.
- The XS child `handleCommand` may be asynchronous after a fashion: it
may return an object and, before the promise queue becomes empty,
set the `result` property of this object to an `ArrayBuffer`.
See the **evaluate and report** test for an example.
- The Node.js parent uses an asynchronous `issueCommand` method to send a
request and receive a response from the XS child.
- The Node.js parent can implement an asynchronous `handleCommand` function to
Expand Down

0 comments on commit 358a49e

Please sign in to comment.