find-or-spawn-repl-thread

swank.core

  • (find-or-spawn-repl-thread conn)
Returns the current connection's repl-thread or create a new one if
the existing one does not exist.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source swank/core.clj:313 top

(defn find-or-spawn-repl-thread
  "Returns the current connection's repl-thread or create a new one if
   the existing one does not exist."
  ([conn]
     ;; TODO - check if an existing repl-agent is still active & doesn't have errors
     (dosync
      (or (when-let [conn-repl-thread @(conn :repl-thread)]
            (when (.isAlive #^Thread conn-repl-thread)
              conn-repl-thread))
          (ref-set (conn :repl-thread)
                   (spawn-repl-thread conn))))))
Vars in swank.core/find-or-spawn-repl-thread: defn dosync or ref-set when when-let
Used in 0 other vars

Comments top

No comments for find-or-spawn-repl-thread. Log in to add a comment.