             (emit-spout! collector [zid @last-timestamp rxns]))
           ; Update timestamp if needed
           (swap! last-timestamp
-                 (fn [last-ts] (apply max 0 last-ts (map :created new-votes))))))
+                 (fn [last-ts] (apply max 0 last-ts (map :created new-votes)))))
+        (Thread/sleep poll-interval))
       (ack [id]))))
 
 

  (:gen-class))


(defspout sim-reaction-spout ["zid" "last-timestamp" "reaction"] {:prepare true}
  [conf context collector]
  (let [at-a-time 10
        interval 1000

        last-timestamp  (atom 0)]
    (spout
      (nextTuple []
        (log/info "Polling :created >" @last-timestamp)
        (let [new-votes (poll/poll pg-spec @last-timestamp)
              grouped-votes (group-by :zid new-votes)]
