My problem is an unexpected situation with executing my clojure program.
I use Ubuntu 14.04 x64, Lein and Clojure(both last versions). I've finished my little project(web crawler, just for learning clojure). It works, I'm sure('cos I've run it in repl).
Ok, I'm trying to run it with lein in terminal (look at screenshot). It works correct, then prints elapsed time. But then, it's waiting for something. That's the problem. Program can't stop and can't give contol back to ubuntu's terminal. I've faced with it first time, all my projects before were complited by itself. Now the only way is "Ctrl + C". In code, I use "imperative" commands(doseq, do), file i/o (with-open reader/writer), agents(send-off, await) and "clj-http.client" for downloading webpages. They are the potential causes.
Here's my "main":
(defn crawl-bunch [depth]
(do
(send-off urls visit-urls)
(await urls)
(renew-urls)
(await urls)
(send-off urls mark-used-urls)
(await urls)
(dec depth)))
(defn crawl [depth]
(loop [i depth]
(if (= i 0)
(save-found-urls "out_urls.txt")
(recur (crawl-bunch i)))))
(defn -main [& args]
(time
(do
(file-to-urls "urls.txt")
(crawl 1))))
Here's full source code - nearly 100 strings (/src/crawler/core.clj): https://github.com/ivanpetrov16130/crawler
Tell me please, how to fix it? Thank you for you answers and excuse me for grammatical, syntax and logical errors.
