                       (do
                         (reset! focus-session-name nil)
                         connections))]
-    (if broadcast connections (take 1 connections))))
+    connections))
 
 (defn trim-last-newline [args]
   (if-let [args (not-empty (filter string? args))]

      (Thread/sleep 500)
      (recur))))

(defn send-for-eval [connections js]
  (send-for-response connections {:op :eval :code js}))

(defn eval-connections [{:keys [focus-session-name
                                broadcast] :as repl-env}]
  (let [connections (connections-available repl-env)
          ;; session focus
        connections (if-let [focus-conn

(defn connection-send [{:keys [send-fn] :as conn} data]
  (send-fn conn data))

(defn send-for-response* [prom conn msg]
  (let [uuid (str (java.util.UUID/randomUUID))
        listener (fn listen [msg]
                   (when (= uuid (:uuid msg))
                     (when-let [result (:response msg)]
                       (deliver prom
                                (if (instance? clojure.lang.IMeta result)
                                  (vary-meta result assoc ::message msg)
                                  result)))
                     (remove-listener listen)))]
    (add-listener listener)
    (try
      (connection-send
       conn
       (json/write-str
        (-> (select-keys conn [:session-id :session-name])
            (merge msg)
            (assoc :uuid uuid))))
      (catch Throwable t
        (remove-listener listener)
        (throw t)))))

(def no-connection-result
  (vary-meta
   {:status :exception
    :value "Expected REPL Connections Evaporated!"
    :stacktrace "No stacktrace available."}
   assoc ::no-connection-made true))

(defn broadcast-for-response [connections msg]
  (let [prom (promise)
        cnt  (->> connections
                  (mapv #(try
                           (send-for-response* prom % msg)
                           true
                           (catch Throwable t
                             nil)))
                  (filter some?)
                  count)]
    (when (zero? cnt)
      (deliver prom no-connection-result))
    prom))

(defn send-for-response [connections msg]
  (let [prom (promise)
        sent (loop [[conn & xc] connections]
               (when conn
                 (if-not (try
                           (send-for-response* prom conn msg)
                           true
                           (catch Throwable t
                             false))
                   (recur xc)
                   true)))]
    (when-not sent
      (deliver prom no-connection-result))
    prom))

(defn http-long-polling-connect [ring-request respond raise]
