Skip to content

Instantly share code, notes, and snippets.

@raspasov
Last active February 13, 2016 01:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raspasov/62f129637cc419bd9449 to your computer and use it in GitHub Desktop.
Save raspasov/62f129637cc419bd9449 to your computer and use it in GitHub Desktop.
(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