Created
March 29, 2018 21:53
-
-
Save sargun/298db9e8aa32a3d5f3cb49c4b2a56c17 to your computer and use it in GitHub Desktop.
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
type IntChannel = ref Channel[int] not nil | |
proc waitForStuff(x : IntChannel) = | |
let val = recv(x[]) | |
echo format("hi: $#", val) | |
proc setupBackground(q : Process) = | |
var x : IntChannel | |
open(x[]) | |
send(x[], 1) | |
spawn (waitForStuff(x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment