I am using the Clojure driver for RethinkDB. I want to get change feeds from a query. Here is what I have so far :
(defn change-feed [conn]
(loop [changes (future
(-> (r/db "mydb")
(r/table "mytable")
r/changes
(r/run conn)))]
(println "date : " ((comp :name :newval) first @changes)) ;;prints nil
(recur (rest changes))))
It blocks in my REPL when called (which is normal). I then add data using the RethinkDB interface. It prints nil
and I get the following error :
IllegalArgumentException Don't know how to create ISeq from: clojure.core$future_call$reify__6736 clojure.lang.RT.seqFrom (RT.java:528)
What am I doing wrong ? I would like to be able to :
- take items from this future
- know also how many items I can take at once (if several are waiting)
Note : I plan to use manifold
to manipulate the result in the end, so any solution using it is completely fine.