Skip to content

Instantly share code, notes, and snippets.

@goodmike
Created January 26, 2010 14:38
Show Gist options
  • Save goodmike/286879 to your computer and use it in GitHub Desktop.
Save goodmike/286879 to your computer and use it in GitHub Desktop.
(def x (promise))
(def y (promise))
(def z (promise))
(def task-z (future (deliver z (+ @x @y))))
(def task-x (future (deliver x 10)))
(def task-y (future (deliver y 5)))
(send-off (agent nil) (print @z))
(send-off (agent nil) #(@task-z))
(send-off (agent nil) #(@task-x))
(send-off (agent nil) #(@task-y))
; at the REPL => 15nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment