update nrepl to run in a thread

This commit is contained in:
Yogthos 2026-06-28 20:02:56 -04:00
parent 28ee005855
commit 8bba526c8c
2 changed files with 93 additions and 2 deletions

View file

@ -188,7 +188,13 @@
(let [port (or (some-> (first (filter #(not (str/starts-with? % "-")) more)) parse-long)
(parse-long (or (jolt.host/getenv "JOLT_NREPL_PORT") "7888")))]
(require 'jolt.nrepl)
((resolve 'jolt.nrepl/start) port (:nrepl-middleware resolved)))))
;; Run the accept loop on a worker thread so the primordial (main) thread
;; stays free to own the GUI main loop. glimmer's run marshals its startup
;; onto this thread via jolt.host/call-on-main-thread — on macOS GTK quartz,
;; g_application_run must run on the main thread or AppKit aborts when it
;; sets the main menu.
(future ((resolve 'jolt.nrepl/start) port (:nrepl-middleware resolved)))
(jolt.host/run-main-pump))))
(defn- usage []
(println "usage: jolt <command> [args]")