Overview
Comment: | wip |
---|---|
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: |
7f562787413cbe3bdafad21d2ab1f09e |
User & Date: | matt on 2020-01-06 22:12:14 |
Other Links: | branch diff | manifest | tags |
Context
2020-01-08
| ||
01:11 | Removed nanomsg from dcommonmon and megamod check-in: 95b4151a44 user: matt tags: v1.70-captain-ulex, v1.70-defunct-try | |
2020-01-06
| ||
22:12 | wip check-in: 7f56278741 user: matt tags: v1.70-captain-ulex, v1.70-defunct-try | |
17:06 | wip check-in: 0390dc30b4 user: mrwellan tags: v1.70-captain-ulex, v1.70-defunct-try | |
Changes
Modified ulex/ulex.scm from [7b7114168d] to [43414b60e9].
︙ | |||
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | + + + + + + + + + + + | (my-port #f) (my-pid (current-process-id)) ;; server and handler thread (serv-listener #f) ;; this processes server info (handler-thread #f) (handlers (make-hash-table)) (outgoing-conns (make-hash-table)) ;; host:port -> conn (mboxes (make-hash-table)) ;; key => mbox (work-queue (make-queue)) ;; most stuff goes here (fast-queue (make-queue)) ;; super quick stuff goes here (e.g. ping) (busy #f) ;; is either of the queues busy ;; app info (appname #f) (dbtypes (make-hash-table)) ;; this should be an alist but hash is easier. dbtype => [ initproc syncproc ] ;; cookies (cnum 0) ;; cookie num ) ;; struct for keeping track of others we are talking to (defstruct peer (addr-port #f) (hostname #f) (pid #f) (inp #f) ;; input port from the peer (oup #f) ;; output port to the peer (owns '()) ;; list of databases this peer is currently handling ) (defstruct work (peer-dat #f) (handlerkey #f) (qrykey #f) (data #f) (start (current-milliseconds))) ;;====================================================================== ;; Captain pkt functions ;;====================================================================== ;; given a pkts dir read ;; (define (get-all-captain-pkts udata) |
︙ | |||
337 338 339 340 341 342 343 | 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + - + - + - - + + | (if (null? params) "" (conc " " (string-intersperse params " ")))) oup) (write-line data oup) ;; NOTE: DO NOT BE TEMPTED TO LOOK AT ANY DATA ON INP HERE! ;; (there is a listener for handling that) )) ;; send a request to the given host-port and register a mailbox in udata ;; wait for the mailbox data and return it ;; (define (send-receive udata host-port handler qrykey data #!key (hostname #f)(pid #f)(params '())) (let ((mbox (make-mailbox)) (mbox-time (current-milliseconds)) (mboxes (udat-mboxes udata))) (hash-table-set! mboxes qrykey mbox) (send udata host-port handler qrykey data hostname: hostname pid: pid params: params) (let* ((mbox-timeout-secs 20) (mbox-timeout-result 'MBOX_TIMEOUT) (res (mailbox-receive! mbox mbox-timeout-secs mbox-timeout-result)) (mbox-receive-time (current-milliseconds))) (hash-table-delete! mboxes qrykey) res))) |
︙ |