diff --git a/packages/xsnap/README.md b/packages/xsnap/README.md index 08a658bdb88..81810337d43 100644 --- a/packages/xsnap/README.md +++ b/packages/xsnap/README.md @@ -43,6 +43,8 @@ The parent and child communicate using "commands". - The Node.js parent can implement an asynchronous `handleCommand` function to respond to commands from the XS child. +![state diagram](doc/xsnap-states.svg) + # xsrepl With `xsnap` comes an `xsrepl` command line tool. diff --git a/packages/xsnap/doc/xsnap-states.dot b/packages/xsnap/doc/xsnap-states.dot new file mode 100644 index 00000000000..0353bfda7c2 --- /dev/null +++ b/packages/xsnap/doc/xsnap-states.dot @@ -0,0 +1,8 @@ +digraph G { + idle -> idle [label="snapshot"] + idle -> running [label="rx:eval"] + idle -> running [label="rx:handleCommand"] + running -> sysCalling [label="tx:issueCommand"] + sysCalling -> running [label="rx:response"] + running -> idle [label="tx:response"] +} diff --git a/packages/xsnap/doc/xsnap-states.svg b/packages/xsnap/doc/xsnap-states.svg new file mode 100644 index 00000000000..71a9dc6ee39 --- /dev/null +++ b/packages/xsnap/doc/xsnap-states.svg @@ -0,0 +1,67 @@ + + +G + + + +idle + +idle + + + +idle->idle + + +snapshot + + + +running + +running + + + +idle->running + + +rx:eval + + + +idle->running + + +rx:handleCommand + + + +running->idle + + +tx:response + + + +sysCalling + +sysCalling + + + +running->sysCalling + + +tx:issueCommand + + + +sysCalling->running + + +rx:response + + + \ No newline at end of file