-
-
Save raspasov/62f129637cc419bd9449 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 p (promise-chan)) | |
(defn test-loops [] | |
(go (let [r (<! p)] | |
(println "got value on promise-chan::" r))) | |
(go (let [r (<! p)] | |
(println "got value on promise-chan::" r)))) | |
(defn test-promise-chan [] | |
(go (>! p 1))) | |
(test-loops) | |
(test-promise-chan) | |
;This prints only once, should be twice? | |
;=> got value on promise-chan:: 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment