Add more flexible prepl api for external tools

This commit is contained in:
Andrey Antukh 2023-01-20 16:51:49 +01:00
parent 8d60b3fc3e
commit bf8a514871
2 changed files with 49 additions and 16 deletions

View file

@ -30,7 +30,7 @@
:init repl-init
:read ccs/repl-read))
(defn json-prepl
(defn json-repl
[]
(let [out *out*
lock (locks/create)]
@ -61,7 +61,7 @@
[[type _] {:keys [::flag port host] :as cfg}]
(when (contains? cf/flags flag)
(let [accept (case type
::prepl 'app.srepl/json-prepl
::prepl 'app.srepl/json-repl
::urepl 'app.srepl/user-repl)
params {:address host
:port port