 ; (STEP 6 "With timeout")
 
 (defn chan-http-get-with-timeout [url timeout result-channel]
-  (let [now     #(System/currentTimeMillis)
+  (let [
+          now     #(System/currentTimeMillis)
         start   (now)
         response (async/chan)]
     (go

(ns clj-tutorials.core
  (:require [org.httpkit.client :as http]
            [clojure.core.async :as async :refer [go <! >!]]))




    (repeatedly number-of-users #(collect-result cs))))


; (STEP 7 "Constantly")

(defn run-constantly [number-of-users number-of-requests timeout url]
  (let [cs       (repeatedly number-of-users async/chan)
        results  (async/chan)]
    (doseq [c cs]
        (chan-http-get-with-timeout url timeout c))
    (go-loop [i 0]
      (let [[result c] (async/alts! cs)]
        (>! results result)
        (chan-http-get-with-timeout url timeout c)
        (when (<= i number-of-requests)
          (recur (inc i)))))
    (repeatedly number-of-requests #(<!! results))))
