The future promises in Clojure hangs on me

When I run the following code, it basically works the way I assume, except that it freezes after the future is over. What am I missing - calls from "close agents / flows"? How can I do it?

(def name-to-greet (promise)) (future (println "Hello," @name-to-greet)) (print "What is your name? ") (flush) (deliver name-to-greet (read-line)) 
+6
concurrency clojure
source share
1 answer

Futures use an agent thread pool that uses non-daemon threads, which means that Clojure will not be closed until you call (shutdown-agents) . imho, this is fake (see my comments here ), and I made suggestions that Rich said he would consider post-1.2 around this.

+7
source share

All Articles