23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
(declare (unit rmt))
(declare (uses api))
(declare (uses http-transport))
(include "common_records.scm")
(declare (uses rmtmod))
(import rmtmod)
;;
;; THESE ARE ALL CALLED ON THE CLIENT SIDE!!!
;;
;; generate entries for ~/.megatestrc with the following
;;
|
>
|
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
(declare (unit rmt))
(declare (uses api))
(declare (uses http-transport))
(include "common_records.scm")
(declare (uses rmtmod))
(import rmtmod)
;;
;; THESE ARE ALL CALLED ON THE CLIENT SIDE!!!
;;
;; generate entries for ~/.megatestrc with the following
;;
|
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
(if cinfo
cinfo
(if (server:check-if-running areapath)
(client:setup areapath)
#f))))
(define *send-receive-mutex* (make-mutex)) ;; should have separate mutex per run-id
;; this entry point can decide based on cmd whether to dispatch to old api calls via remote or via ulex
;;
(define (rmt:send-receive cmd rid params #!key (attemptnum 1)(area-dat #f))
(rmt:send-receive-orig cmd rid params attemptnum: attemptnum area-dat: area-dat))
;; RA => e.g. usage (rmt:send-receive 'get-var #f (list varname))
;;
(define (rmt:send-receive-orig cmd rid params #!key (attemptnum 1)(area-dat #f)) ;; start attemptnum at 1 so the modulo below works as expected
#;(common:telemetry-log (conc "rmt:"(->string cmd))
payload: `((rid . ,rid)
|
>
>
>
>
>
>
>
>
>
|
|
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
(if cinfo
cinfo
(if (server:check-if-running areapath)
(client:setup areapath)
#f))))
(define *send-receive-mutex* (make-mutex)) ;; should have separate mutex per run-id
;; this entry point can decide based on cmd whether to dispatch to old api calls via remote or via ulex
;;
(define (rmt:send-receive cmd rid params #!key (attemptnum 1)(area-dat #f))
(if (member cmd '(blah))
(begin
(mutex-lock! *send-receive-mutex*)
(if (not *runremote*)(set! *runremote* (make-remote)))
(let ((ulex:conn (remote-ulex:conn *runremote*)))
(if (not ulex:conn)(remote-ulex:conn-set! *runremote* (rmtmod:setup-ulex *toppath*)))
(rmtmod:send-receive-ulex ulex:conn cmd rid params attemptnum area-dat)))
(rmt:send-receive-orig cmd rid params attemptnum: attemptnum area-dat: area-dat)))
;; RA => e.g. usage (rmt:send-receive 'get-var #f (list varname))
;;
(define (rmt:send-receive-orig cmd rid params #!key (attemptnum 1)(area-dat #f)) ;; start attemptnum at 1 so the modulo below works as expected
#;(common:telemetry-log (conc "rmt:"(->string cmd))
payload: `((rid . ,rid)
|