Skip to content

Instantly share code, notes, and snippets.

@sargun
Created March 29, 2018 21:53
Show Gist options
  • Save sargun/298db9e8aa32a3d5f3cb49c4b2a56c17 to your computer and use it in GitHub Desktop.
Save sargun/298db9e8aa32a3d5f3cb49c4b2a56c17 to your computer and use it in GitHub Desktop.
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