Cassaforte / clojure: endless program

I am trying to use Cassaforte to request my db cassandra, but when I run my code, it never ends.

(defn cassandra []
  (let [conn (cc/connect ["127.0.0.1", "127.0.0.2", "127.0.0.3"])
        table "mytable"]
    (cql/use-keyspace conn "mykeyspace")
    (cql/select conn table (limit 10))))

(defn -main
  "I don't do a whole lot ... yet"
  [& args]
  (println "Hello, World!")
  (let [result (cassandra)]))

Result:

$ lein run
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Hello, World!
[the program is waiting here]

If I print the result of var, it contains the lines, but with the same problem after.

Any idea?

+4
source share
1 answer

Your program is finished, you simply did not tell the JVM that you obviously want to exit at the end of main. You can do this by adding:

(System/exit 0) 

. , java, Clojure , . JVM , - , . Clojure .

+3

Source: https://habr.com/ru/post/1598655/


All Articles