Overview
Comment: | wip-cleaning-up-send-receive |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.70-captain-ulex | v1.70-defunct-try |
Files: | files | file ages | folders |
SHA1: |
1dbae7035b53065ca2f4215ca76f6866 |
User & Date: | matt on 2020-01-22 22:33:23 |
Other Links: | branch diff | manifest | tags |
Context
2020-01-28
| ||
20:07 | some forgotten changes... hopefully good changes. check-in: f86d0abaad user: matt tags: v1.70-captain-ulex, v1.70-defunct-try | |
2020-01-22
| ||
22:33 | wip-cleaning-up-send-receive check-in: 1dbae7035b user: matt tags: v1.70-captain-ulex, v1.70-defunct-try | |
2020-01-21
| ||
19:19 | Switch from write-line and read-line to write and read for transport across the tcp connection check-in: 124ed3f5a6 user: matt tags: v1.70-captain-ulex, v1.70-defunct-try | |
Changes
Modified rmtmod.scm from [1d07182ee0] to [0b58aa78dc].
︙ | |||
96 97 98 99 100 101 102 | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | - - + + + - + - | ;; 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)) (dbtype (if (or (not rid)(< rid 1)) ;; this is the criteria for "main.db" |
︙ |
Modified ulex/ulex.scm from [f8b8e960d6] to [e99055ba4e].
︙ | |||
77 78 79 80 81 82 83 | 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 | - + - + - + - - - + + | (remove-captain-pkt udata captn) (setup))))) (begin (setup-as-captain udata) ;; this saves the thread to captain-thread and starts the thread (setup))))) ;; connect to a specific dbfile |
︙ | |||
153 154 155 156 157 158 159 | 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | - - + - + - - - + | (let* ((dbrec (ulex-open-db udata dbname)) ;; this will be a dbconn record, looks for in udata first (proc (hash-table-ref udata prockey))) (let* ((result (proc dbrec procparam data))) result))) ;; remote-request - send to remote to process in process-request ;; uconn comes from a call to connect and can be used instead of calling connect again |
︙ | |||
298 299 300 301 302 303 304 | 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | - + | (defstruct work (peer-dat #f) (handlerkey #f) (qrykey #f) (data #f) (start (current-milliseconds))) |
︙ | |||
414 415 416 417 418 419 420 | 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 | - + | peers))) ;;====================================================================== ;; server primitives ;;====================================================================== (define (make-cookie udata) |
︙ | |||
536 537 538 539 540 541 542 | 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 | - + | ((ping) ;; special case - return result immediately on the same connection (let* ((proc (hash-table-ref/default (udat-handlers udata) 'ping #f)) (val (if proc (proc) "gotping")) (peer (make-peer addr-port: host-port pid: pid)) (dbshash (udat-dbowners udata))) (peer-dbs-set! peer params) ;; params for ping is list of dbs owned by pinger (for-each (lambda (dbfile) |
︙ | |||
565 566 567 568 569 570 571 | 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 | - + - + - + - + + | ((db-owner) ;; given a db name who do I send my queries to ;; look up the file in handlers, if have an entry ping them to be sure ;; they are still alive and then return that host:port. ;; if no handler found or if the ping fails pick from peers the oldest that ;; is managing the fewest dbs (match params ((dbfile dbtype) |
︙ |