   (if-let [url (:http request)]
     (partial http/async-http-request url)
     (:fn request)))
-
-(defn- request-result [id request-name success start]
-  {:id id :name request-name :result success :start start :end (now)})
 
 (defn async-function-with-timeout [request timeout user-id context result-channel]
   (let [start    (now)

   :end (:end (last result))
   :requests result})

(defn- run-requests-constantly [runner cs timeout scenario scenario-start concurrency]
  (let [requests (:requests scenario)
        results (async/chan)]
    (go-loop [^long i 0]
      (let [[result c] (alts! cs)]
        (when (continue-run? runner scenario-start (+ i concurrency))
          (run-requests requests timeout (+ i concurrency) c))
        (>! results (response->result scenario result))
        (when (continue-run? runner scenario-start i)
          (recur (inc i)))))
    results))

(defn run-scenario [runner concurrency number-of-requests timeout scenario]
  (println (str "Running scenario " (:name scenario) " with " concurrency " concurrency and

            [clj-time.core :as time]
            [clj-time.local :as local-time]
            [clojure.core.async :as async :refer [go go-loop put! <!! alts! <! >!]]))

(defn- now [] (System/currentTimeMillis))

