Megatest

Diff
Login

Differences From Artifact [1582aa56da]:

To Artifact [cfa1ca3a75]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
;;======================================================================
;; Copyright 2006-2013, Matthew Welland.
;; 
;;  This program is made available under the GNU GPL version 2.0 or
;;  greater. See the accompanying file COPYING for details.
;; 
;;  This program is distributed WITHOUT ANY WARRANTY; without even the
;;  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
;;  PURPOSE.
;;======================================================================

(use json format) ;; RADT => purpose of json format??

(declare (unit rmt))
(declare (uses api))
(declare (uses tdb))
(declare (uses http-transport))
;;(declare (uses nmsg-transport))










|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
;;======================================================================
;; Copyright 2006-2013, Matthew Welland.
;; 
;;  This program is made available under the GNU GPL version 2.0 or
;;  greater. See the accompanying file COPYING for details.
;; 
;;  This program is distributed WITHOUT ANY WARRANTY; without even the
;;  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
;;  PURPOSE.
;;======================================================================
;;
(use json format) ;; RADT => purpose of json format??

(declare (unit rmt))
(declare (uses api))
(declare (uses tdb))
(declare (uses http-transport))
;;(declare (uses nmsg-transport))
33
34
35
36
37
38
39


























40
41
42
43
44
45
46
;;
;;  grep define ../rmt.scm | grep rmt: |perl -pi -e 's/\(define\s+\((\S+)\W.*$/\1/'|sort -u


;;======================================================================
;;  S U P P O R T   F U N C T I O N S
;;======================================================================



























;; if a server is either running or in the process of starting call client:setup
;; else return #f to let the calling proc know that there is no server available
;;
(define (rmt:get-connection-info run-id)
  (let ((cinfo *runremote*)) ;; (hash-table-ref/default *runremote* run-id #f)))
    (if cinfo







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
;;
;;  grep define ../rmt.scm | grep rmt: |perl -pi -e 's/\(define\s+\((\S+)\W.*$/\1/'|sort -u


;;======================================================================
;;  S U P P O R T   F U N C T I O N S
;;======================================================================

;; thread-safe interface to *runremote* hash
(define *rrr-mutex* (make-mutex))
(define (rmt:get-cinfo rid)
  (mutex-lock! *rrr-mutex*)
  (let* ((run-id (if rid rid 0))
         (cinfo (hash-table-ref/default *runremote* run-id #f)))
    (mutex-unlock! *rrr-mutex*)
    cinfo))

(define (rmt:set-cinfo rid server-dat)
  (mutex-lock! *rrr-mutex*)
  (let* ((run-id (if rid rid 0))
         (res (hash-table-set! *runremote* run-id server-dat)))
    (mutex-unlock! *rrr-mutex*)
    res))

(define (rmt:del-cinfo rid)
  (mutex-lock! *rrr-mutex*)
  (let* ((run-id (if rid rid 0))
         (res (hash-table-delete! *runremote* run-id)))
    (mutex-unlock! *rrr-mutex*)
    res))




;; if a server is either running or in the process of starting call client:setup
;; else return #f to let the calling proc know that there is no server available
;;
(define (rmt:get-connection-info run-id)
  (let ((cinfo *runremote*)) ;; (hash-table-ref/default *runremote* run-id #f)))
    (if cinfo