Why does a clojure future block the main thread?
问题 I have a trivial lein project where -main contains a future: (def f (future 42)) (defn -main [& args] (println @f)) When I run lein run it prints 42 but does not return. I don't understand why it does not return ? How do I get lein run to return ? 回答1: Your question is really twofold: Why does lein not return? lein hangs because the thread pool which backs Clojure futures does not use daemon threads so you have to explicitly shut it down. If you change your code to the following, it should