From 358a49ec800e768d87645c37d5eb639f2215daa6 Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Sat, 23 Jan 2021 11:19:34 -0600 Subject: [PATCH] docs(xsnap): document XS handleCommand async idiom --- packages/xsnap/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/xsnap/README.md b/packages/xsnap/README.md index 9bf906a71213..47074ceb4e89 100644 --- a/packages/xsnap/README.md +++ b/packages/xsnap/README.md @@ -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