 (defn apply-diff [map-key _new old]
   {:pre [(map? _new) (map? old)]}
   (fn [] 
-    (letfn [(sub [a b] (clojure.set/difference (into #{} a) (into #{} b)))]
+    (letfn [(sub [a b] (difference (into #{} a) (into #{} b)))]
       (doseq [[k v] (sub old _new)] (wcar (car/hdel map-key k)))
       (doseq [[k v] (sub _new old)] (wcar (car/hset map-key k (car/preserve v))))
       )))

(ns celestial.redis
  "Redis utilities like a distributed lock, connection managment and ref watcher"
  (:use  
    [celestial.common :only (config curr-time)]
    [clojure.core.strint :only (<<)]
    [slingshot.slingshot :only  [throw+]]

       (atom {}))))

(defn create-worker [name f]
  (carmine-mq/make-dequeue-worker (pool) (spec-server) name :handler-fn f))

(defn clear-all []
  (wcar (car/flushdb)))
