Overview
Comment: | Just randomly tried mailbox/mailbox and it seems to be working pretty well. Wierd. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v2.0001 |
Files: | files | file ages | folders |
SHA1: |
3d29ed0bb135d858a642678e014d738d |
User & Date: | matt on 2022-01-10 17:46:40 |
Other Links: | branch diff | manifest | tags |
Context
2022-01-11
| ||
09:00 | Go back to single log for a server. The splitting of the logs was not proving useful check-in: b4ff9e2f1d user: matt tags: v2.0001 | |
2022-01-10
| ||
17:46 | Just randomly tried mailbox/mailbox and it seems to be working pretty well. Wierd. check-in: 3d29ed0bb1 user: matt tags: v2.0001 | |
07:55 | Use ulex-simple to explore using tcp-server egg check-in: f885e8c541 user: matt tags: v2.0001 | |
Changes
Modified ulex-trials/Makefile from [e108f86d9a] to [cec464a43d].
|
| | | | 1 2 3 4 5 6 7 8 | ulex-test : ulex-test.scm ../ulex/ulex.scm csc ulex-test.scm test : ulex-test for x in $$(seq 9);do export NBFAKE_LOG=NBFAKE_$$x;sleep 1;nbfake ./ulex-test run 828$$x;echo $$cmd;$$cmd;done clean : rm -f .runners/* NBFAKE* |
Modified ulex-trials/ulex-test.scm from [563b467581] to [f76ffe0828].
︙ | ︙ | |||
22 23 24 25 26 27 28 | directory-utils ulex ) (define help "Usage: ulex-test COMMAND where COMMAND is one of: | < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < | < | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | directory-utils ulex ) (define help "Usage: ulex-test COMMAND where COMMAND is one of: run host:port : start test server - start several in same dir ") (define (call uconn msg addr) (print "Sent: "msg", received: " (send-receive uconn addr 'hello msg))) ;; start => hello 0 ;; hello 0 => hello 1 ;; hello 1 => hello 2 ;; ... ;; hello 11 => 'done ;; |
︙ | ︙ | |||
110 111 112 113 114 115 116 | (conc msg " 0")) (else "hello 0")))) (define (main) (match (command-line-arguments) | < | > | > > | | < < < < | < | | | 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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | (conc msg " 0")) (else "hello 0")))) (define (main) (match (command-line-arguments) ((run myport) ;; start listener ;; put myaddr into file by host-pid in .runners ;; for 1 minute ;; get all in .runners ;; call each with a message ;; (let* ((port (string->number myport)) (endtimes (+ (current-seconds) 20)) ;; run for 20 seconds (handler (lambda (rem-host-port qrykey cmd params) (process-message params))) (uconn (run-listener handler myport)) (rfile (conc ".runners/"(get-host-name)"-"(current-process-id)))) (if (not (and (file-exists? ".runners") (directory? ".runners"))) (create-directory ".runners" #t)) (with-output-to-file rfile (lambda () (print myport))) (let loop ((entries '())) (if (> (current-seconds) endtimes) (begin (delete-file* rfile) (sleep 1) (exit)) (if (null? entries) (loop (glob ".runners/*")) (let* ((entry (car entries)) (destaddr (with-input-from-file entry read-line))) (call uconn (conc "hello-from-"myport"to-"destaddr) destaddr) ;; (thread-sleep! 0.025) (loop (cdr entries)))))))) ((cmd)(print "ERROR: command "cmd", not recognised.\n\n"help)) (else (print help)))) ) ;; end module (import ulex-test) (main) |
Modified ulex.scm from [64369b6c76] to [f004a2cedd].
︙ | ︙ | |||
16 17 18 19 20 21 22 | ;; You should have received a copy of the GNU General Public License ;; along with Megatest. If not, see <http://www.gnu.org/licenses/>. ;;====================================================================== (declare (unit ulex)) | | | | 16 17 18 19 20 21 22 23 24 | ;; You should have received a copy of the GNU General Public License ;; along with Megatest. If not, see <http://www.gnu.org/licenses/>. ;;====================================================================== (declare (unit ulex)) (include "ulex/ulex.scm") ;; (include "ulex-simple/ulex.scm") |
Modified ulex/ulex.scm from [ded9484f4d] to [70c15d4319].
︙ | ︙ | |||
22 23 24 25 26 27 28 | ;; See README in the distribution at https://www.kiatoa.com/fossils/ulex ;; NOTES: ;; Why sql-de-lite and not say, dbi? - performance mostly, then simplicity. ;; ;;====================================================================== (module ulex | < > > | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ;; See README in the distribution at https://www.kiatoa.com/fossils/ulex ;; NOTES: ;; Why sql-de-lite and not say, dbi? - performance mostly, then simplicity. ;; ;;====================================================================== (module ulex * #;( ;; NOTE: looking for the handler proc - find the run-listener :) run-listener ;; (run-listener handler-proc [port]) => uconn ;; NOTE: handler-proc params; ;; (handler-proc rem-host-port qrykey cmd params) |
︙ | ︙ | |||
105 106 107 108 109 110 111 | (work-queue-thread #f) (num-threads-running 0) ) ;; Parameters ;; work-method: | | | | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | (work-queue-thread #f) (num-threads-running 0) ) ;; Parameters ;; work-method: (define work-method (make-parameter 'mailbox)) ;; mailbox - all rdat goes through mailbox ;; threads - all rdat immediately executed in new thread ;; direct - no queuing ;; ;; return-method, return the result to waiting send-receive: (define return-method (make-parameter 'mailbox)) ;; mailbox - create a mailbox and use it for passing returning results to send-receive ;; polling - put the result in a hash table keyed by qrykey and send-receive can poll it for result ;; direct - no queuing, result is passed back in single tcp connection ;; ;; ;; struct for keeping track of others we are talking to ;; ;; |
︙ | ︙ |