Skip to content

Commit 8db89a5

Browse files
committed
make run/step/etc commands to debugee non blocking, fixes #10
1 parent 73bca07 commit 8db89a5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/mobdap/debug_server.clj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
(:require
33
[clj-stacktrace.core :refer [parse-exception]]
44
[clj-stacktrace.repl :refer [pst-str]]
5-
[clojure.core.async :refer [<!! >!! chan go-loop thread]]
5+
[clojure.core.async :refer [<!! >!! chan go go-loop thread]]
66
[clojure.string :as string]
77
[mobdap.lua :as lua]
88
[taoensso.timbre :as log])
@@ -117,7 +117,7 @@
117117
(when-let [command (<!! to-debug-server)]
118118
(log/info "Handler -> Debug Server:" command)
119119
(case (:cmd command)
120-
:run (send-command! server-handle "run")
120+
:run (go (send-command! server-handle "run"))
121121

122122
:set-breakpoints (do
123123
; this command only gets called before executing a command so we
@@ -128,11 +128,11 @@
128128
{:keys [line]} breakpoints]
129129
(send-command-setb! server-handle filename line)))
130130

131-
:step-in (send-command! server-handle "step")
131+
:step-in (go (send-command! server-handle "step"))
132132

133-
:step-out (send-command! server-handle "out")
133+
:step-out (go (send-command! server-handle "out"))
134134

135-
:over (send-command! server-handle "over")
135+
:over (go (send-command! server-handle "over"))
136136

137137
:stacktrace (let [stack (send-command-stack! server-handle)]
138138
(>!! to-adapter {:cmd :stacktrace :stack stack :seq (:seq command)}))

0 commit comments

Comments
 (0)