Created
January 26, 2010 14:38
-
-
Save goodmike/286879 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
(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