 (defn perform-actions [n coll]
   (go
     (let [ch (to-chan coll)
-          workers (->> (range n) (map (fn [_] (perform-action ch))) (vec))]
-      (let [results (<! (async/map (fn [err _] err) workers))
-            err (reduce #(or %1 %2) nil results)
-            res (if err nil true)]
-        [err res]))))
+          results
+          (->>
+            (range n)
+            (map (fn [_] (perform-action ch)))
+            (vec)
+            (async/merge)
+            (async/into [])
+            (<!)
+            (map (fn [[err _]] err)))
+          err (reduce #(or %1 %2) nil results)
+          res (if err nil true)]
+      [err res])))
 
 (defn object-props [content-type max-age]
   {:content-type content-type

    (go
      (let [msg (str "updating '" relpath "' to S3")]
        (log-action verbose whatif verbose "Comparing local '" relpath "' with remote.")
        (log-action true whatif verbose "Started " msg ".")
        (log-action verbose whatif verbose "Finished " msg ".")
        [nil true]))))

(defn bucketsync
  {:summary "Synchronize a remote Amazon S3 bucket with a local asset directory."

                          (concat
                            (map #(make-copy-file-action s3 % whatif verbose) onlylocal)
                            (->> onlyremote
                                 (map (fn [[key _]] key))
                                 (filter #(not (re-find remote-key-white-list %)))
                                 (partition-all 1000)
                                 (map #(make-delete-file-action s3 % delete whatif verbose)))
                            (map #(make-update-file-action s3 % force whatif verbose) both))
