     (doseq [ ts-sensor-reading (->timestamped-readings (poll-sensor sensor-def)) ]
       (process-sensor-reading (:sensor-name sensor-def) ts-sensor-reading))))
 
-(defn take-result-queue-snapshot [ ]
+(defn take-result-queue-snapshot [ snapshot-size-limit ]
   (let [ snapshot (java.util.concurrent.LinkedBlockingQueue.) ]
     (locking sensor-result-queue
-      (.drainTo sensor-result-queue snapshot))
+      (log/info "Taking snapshot queue with n:" (.size sensor-result-queue) ", limit:" snapshot-size-limit)
+      (.drainTo sensor-result-queue snapshot snapshot-size-limit ))
     (seq snapshot)))
 
 (def update-queue (java.util.concurrent.LinkedBlockingQueue.))

  (try 
    ((:sensor-fn sensor-def))
    (catch Exception ex
      (log/error "Error polling sensor" (:sensor-name sensor-def) (str ex))
      false)))

(defn process-sensor-reading [ sensor-name ts-sensor-reading ]

            [cognitect.transit :as transit]
            [clj-time.format :as time-format]
            [clj-time.coerce :as time-coerce]))

(def update-size-limit 200)

(defn pr-transit [ val ]
  (let [out (java.io.ByteArrayOutputStream. 4096)
