-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathclient.el
More file actions
34 lines (25 loc) · 892 Bytes
/
client.el
File metadata and controls
34 lines (25 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
(require 'epc)
(when noninteractive
(load "subr")
(load "byte-run"))
(eval-when-compile (require 'cl))
(message "Start EPC")
(defvar my-epc-server-py
(expand-file-name "server.py"
(file-name-directory
(or load-file-name buffer-file-name))))
(defvar my-epc (epc:start-epc (or (getenv "PYTHON") "python")
(list my-epc-server-py)))
(message "Start request")
(deferred:$
(epc:call-deferred my-epc 'echo '(10))
(deferred:nextc it
(lambda (x) (message "Return : %S" x))))
(message "Return : %S" (epc:call-sync my-epc 'echo '(10 40)))
(loop for i from 1 to 5
do (deferred:$
(epc:call-deferred my-epc 'echo (list i))
(deferred:nextc it
(lambda (x) (message "Return : %S" x)))))
(message "Return : %S"
(epc:sync my-epc (epc:query-methods-deferred my-epc)))