-
-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Same idea as channels from Go. Also add a select primitive that can take a list of pairs of channels and code objects, and invokes the code object for whichever channel has a value first. The select implementation is an utter hack, but it will let us play with the idea and API. Both await and select can be used with promises, so you could use a Promise.sleep(2) along with a channel in a select to time out if the channel does not have a value within two seconds.
- Loading branch information
Showing
1 changed file
with
73 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters