Initial async work

Operations can now:
1) return their progress directly.
2) throw an error.
3) (ADDED) return a promise:
  + that resolves to their progress.
  + that rejects an error message (like throwing but asynchronous).
  For an example see the new operation "Wait" (Flow Control)

Added a flow control operation "Wait", which waits for the number of
milliseconds passed in as its argument. It is a fairly useless operation
but it does demonstrate how asynchronous operations now work.

A recipe like:
```
Fork
Wait (1000ms)
```
will only wait for 1000ms (each wait runs at the same time as each
other).

I have not looked into performance implications yet, also this code is
probably more complicated than it needs to be (would love help on this).
This commit is contained in:
toby 2017-02-14 14:46:35 -05:00
parent 11e972ff26
commit 343d350af8
8 changed files with 346 additions and 108 deletions

View file

@ -285,6 +285,7 @@ var Categories = [
"Jump",
"Conditional Jump",
"Return",
"Wait",
]
},
];