cljs.repl.browser/handle-post

multimethodsince v0.0-927Edit
(handle-post m _ _)

Source code @ clojurescript:src/main/clojure/cljs/repl/browser.clj
(defmulti handle-post (fn [m _ _ ] (:type m)))

Dispatch method @ clojurescript:src/main/clojure/cljs/repl/browser.clj
(defmethod handle-post :ready [_ conn _]
  (send-via es ordering (fn [_] {:expecting nil :fns {}}))
  ;; browser refresh, reset connq
  (locking server/lock
    (.clear server/connq))
  (send-for-eval conn
    (binding [ana/*cljs-warnings*
              (assoc ana/*cljs-warnings*
                :undeclared-var false)]
      (cljsc/-compile
       '[(set! *print-fn* clojure.browser.repl/repl-print)
         (set! *print-err-fn* clojure.browser.repl/repl-print)
         (set! *print-newline* true)
         (when (pos? (count clojure.browser.repl/print-queue))
           (clojure.browser.repl/flush-print-queue!
             @clojure.browser.repl/xpc-connection))] {}))
    identity))

Dispatch method @ clojurescript:src/main/clojure/cljs/repl/browser.clj
(defmethod handle-post :print [{:keys [repl content order]} conn _]
  (constrain-order order
    (fn []
      (binding [*out* (or (and repl (.get outs repl)) *out*)]
        (print (read-string content))
        (.flush *out*))))
  (server/send-and-close conn 200 "ignore__"))

Dispatch method @ clojurescript:src/main/clojure/cljs/repl/browser.clj
(defmethod handle-post :result [{:keys [content order]} conn _]
  (constrain-order order
    (fn []
      (return-value content)
      (server/set-connection conn))))