 
 
 (defn- ->Duratom ;; shadow the generated constructor-fns
-  [make-async-backend lock init]
+  [make-backend lock init]
   (assert (or (ut/lock? lock)
-              (nil? lock)) "The <lock> provided is neither a valid implementation of `java.util.concurrent.locks.Lock`, nor nil!")
+              (nil? lock))
+          "The <lock> provided is neither a valid implementation of `java.util.concurrent.locks.Lock`, nor nil!")
   (let [raw-atom (atom nil)
-        backend (make-async-backend (agent raw-atom))
+        backend (make-backend (agent raw-atom))
         duratom (Duratom. backend raw-atom lock (ut/releaser))
         storage-init (doto duratom read_in)]
     (if (some? @storage-init) ;; found stuff

              (some? init) (doto (reset! init)))))) ;; empty storage means we start off with <initial-value>

(defn- map->Duratom [m]
  (let [[make-async-backend lock initial-value] ((juxt :make-async-backend :lock :init) m)]
    (->Duratom make-async-backend lock initial-value)))


;;==================<PUBLIC API>==========================

  ([creds bucket k lock initial-value]
   (map->Duratom {:lock lock
                  :init initial-value
                  :make-backend (partial storage/->S3Backend
                                         creds
                                         (if (ut/does-bucket-exist creds bucket)
                                           bucket
                                           (do (ut/create-s3-bucket creds bucket)
                                               bucket))
                                         k)
                  })))


