Megatest

Diff
Login

Differences From Artifact [5550ea1678]:

To Artifact [5c3bd41b91]:


77
78
79
80
81
82
83
84

85

86
87
88
89
90
91
92
93
94
95
96
97
98
99
100






101
102
103
104
105
106
107
77
78
79
80
81
82
83

84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114







-
+

+















+
+
+
+
+
+







;;    - finds the "captain" and asks who to talk to for the given dbfname
;;    - establishes the connection to the current dbowner
;;
(define (rmt:connect alldat dbfname)
  (let* ((ulexdat    (let ((uconn (alldat-ulexdat alldat)))
		       (if uconn
			   uconn
			   (let* ((new-ulexdat (ulex:setup))) ;; establish connection to ulex
	  		   (let* ((new-ulexdat (ulex:setup))) ;; establish connection to ulex
			     (alldat-ulexdat-set! alldat new-ulexdat)
			     (rmt:setup-ulex alldat)
			     new-ulexdat)))))
    (ulex:connect ulexdat dbfname)))

;; set up a connection to the current owner of the dbfile associated with rid
;; then send the query to that dbfile owner and wait for a response.
;;
(define (rmt:send-receive cmd rid params #!key (attemptnum 1)(area-dat #f)) ;; start attemptnum at 1 so the modulo below works as expected
  (let* ((alldat   *alldat*)
	 (areapath (alldat-areapath alldat))
	 (dbfname  (if (or (not rid)(< rid 1)) ;; this is the criteria for "main.db"
		       "main.db"
		       (conc rid ".db")))
	 (dbfile   (conc areapath "/.db/" dbfname))
	 (ulexconn (rmt:connect alldat dbfname)))  
    (rmt:open-qry-close-locally cmd 0 params)))

;; setup the remote calls
(define (rmt:setup-ulex alldat)
  (let ((udata (alldat-ulexdat alldat)))
    (ulex:register-handler udata 'ping common:get-full-version)
  ))
;;   
;; ;; #;(common:telemetry-log (conc "rmt:"(->string cmd))
;; ;; #;(define (rmt:send-receive 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)
;; ;; (params . ,params)))