Skip to content

Commit

Permalink
Keep track of the process' state
Browse files Browse the repository at this point in the history
Fixes #52
  • Loading branch information
dgutov committed Feb 19, 2015
1 parent 69d8d06 commit db5012b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion robe.el
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,16 @@ project."
(when failed
(ruby-switch-to-inf t)
(error "Robe launch failed"))
(accept-process-output proc)))
(accept-process-output proc))
(set-process-sentinel proc #'robe-process-sentinel))
(set-process-filter proc comint-filter)))
(when (robe-request "ping") ;; Should be always t when no error, though.
(setq robe-running t))))

(defun robe-process-sentinel (proc _event)
(when (memq (process-status proc) '(signal exit))
(setq robe-running nil)))

(defun robe-request (endpoint &rest args)
(declare (special url-http-end-of-headers))
(let* ((url (format "http://127.0.0.1:%s/%s/%s" robe-port endpoint
Expand Down

0 comments on commit db5012b

Please sign in to comment.