              ;; [com.keminglabs.zmq-async.core :refer [register-socket!]]
             [org.httpkit.client :as http]
             [clojure.core.async
-             :refer [chan go partition map< split >! <! take! alts!!]
+             :refer [chan go partition map< split >! <! take! alts! alts!!]
              :as async]))
 
 (def BASE_URI "https://www.googleapis.com/youtube/v3/videos")

  [api-key video-ids]
  (mk-pipeline-chan api-key video-ids))

(defn enq-responses
  [out-ch n-times]
  (let [in-ch (chan)]
    (go (dotimes [_ n-times]
          (async/>! in-ch (deref (async/<! out-ch)))))
    in-ch))

(defn deq-responses
  [out-ch n-times]
  (dotimes [_ n-times]
    (let [[v c] (async/alts!! [out-ch])]
      (println v))))

(defn query-count [seq]
  (/ (count seq) IDS_PER_QUERY))

  (->> (async/to-chan video-ids)
       (async/partition IDS_PER_QUERY)
       (async/map< #(uris/mk-video-uri api-key %))
       (async/map< http/get)))

;; Could also do this?
