Skip to content

Instantly share code, notes, and snippets.

@skanev
Created December 31, 2010 10:18
Show Gist options
  • Select an option

  • Save skanev/760911 to your computer and use it in GitHub Desktop.

Select an option

Save skanev/760911 to your computer and use it in GitHub Desktop.
val waiter = actor {
var result = 0.0
def once(body: => Unit) = body
def waitForResult = react { case Result(num) => result = num }
def replyToEval = react { case 'Eval => reply(result) }
once { waitForResult } andThen { replyToEval }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment