               pkeys (set-keys! mkeys tenant period rollup time path ttl
                                cache-get fn-agg fn-store cache-key)
               adata (get-data @pkeys)]
-          (swap! adata #(assoc % ckey (conj (get % ckey) data)))))
+          (swap! adata #(assoc % ckey (conj (get % ckey) data)))
+          ;;(-show-keys this)
+          ;;(-show-cache this)
+          ;;(-show-meta this)
+          ))
       (flush! [this]
         (run-flusher! mkeys))
-      (-show-keys [this] (println "MKeys:" mkeys))
+      (-show-keys [this] (debug "MKeys:" mkeys))
       (-show-cache [this]
-        (println "Cache:")
+        (debug "Cache:")
         (doseq [[mkey pkeys] @mkeys]
-          (println (get-data @pkeys))))
+          (debug (get-data @pkeys))))
       (-show-meta [this]
         (doseq [[mkey pkeys] @mkeys]
-          (println "Meta:" mkey (meta @pkeys)))))))
+          (debug "Meta:" mkey (meta @pkeys)))))))

(defn create-flusher
  [mkeys mkey pkeys tenant period rollup time ttl fn-get fn-agg fn-store fn-key]
  (fn []
    (doseq [path @pkeys]
      (fn-store tenant period rollup time path
                (fn-agg (fn-get
                         (fn-key tenant period rollup time path)
                         @pkeys)) ttl))
    (swap! mkeys #(dissoc % mkey))))

(defn run-delayer!
  [rollup fn-flusher]

(ns org.spootnik.cyanite.store_cache
  "Caching facility for Cyanite"
  (:require [clojure.string :as str]
            [clojure.core.async :as async :refer [>!!]]
            [clojure.tools.logging :refer [error info debug]]
            [org.spootnik.cyanite.store :as store]))

