Overview
Comment: | Sync back implemented, compiles but not tested |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.80-tcp-inmem |
Files: | files | file ages | folders |
SHA1: |
c70de6806c081266ac8c39415857f28b |
User & Date: | matt on 2023-02-19 21:23:06 |
Other Links: | branch diff | manifest | tags |
Context
2023-02-19
| ||
22:01 | misc needed fixes check-in: 263e0fe253 user: matt tags: v1.80-tcp-inmem | |
21:23 | Sync back implemented, compiles but not tested check-in: c70de6806c user: matt tags: v1.80-tcp-inmem | |
20:14 | list runs now working with data sync'd from ondisk to inmem (but no last_update support). check-in: 12db00e83a user: matt tags: v1.80-tcp-inmem | |
Changes
Modified dbfile.scm from [bad40329ba] to [90e09d3f1a].
︙ | |||
62 63 64 65 66 67 68 69 70 71 72 73 74 75 | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | + + | ;; ;; for the inmem approach (see dbmod.scm) ;; this is one db per server (inmem #f) ;; handle for the in memory copy (dbfile #f) ;; path to the db file on disk (ondiskdb #f) ;; handle for the on-disk file (dbdat #f) ;; create a dbdat for the downstream calls such as db:with-db (last-update 0) (syncback-proc #f) ) ;; NOTE: Need one dbr:subdb per main.db, 1.db ... ;; (defstruct dbr:subdb (dbname #f) ;; .megatest/1.db (mtdbfile #f) ;; mtrah/.megatest/1.db |
︙ |
Modified dbmod.scm from [d5396ce900] to [5da8a7fe52].
︙ | |||
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | + + + | (if write-access (init-proc db)) db)))) (tables (db:sync-all-tables-list keys))) (dbr:dbstruct-inmem-set! dbstruct inmem) (dbr:dbstruct-ondiskdb-set! dbstruct db) (dbr:dbstruct-dbfile-set! dbstruct dbfullname) (dbr:dbstruct-syncback-proc-set! dbstruct (lambda (last-update) (dbmod:sync-tables tables last-update inmem db))) (dbmod:sync-tables tables #f db inmem) (dbr:dbstruct-last-update-set! dbstruct (current-seconds)) ;; should this be offset back in time by one second? dbstruct)) (define (dbmod:close-db dbstruct) ;; do final sync to disk file ;; (do-sync ...) (sqlite3:finalize! (dbr:dbstruct-ondiskdb dbstruct))) |
︙ |
Modified tcp-transportmod.scm from [0ef29c3cc2] to [ced741c85e].
︙ | |||
269 270 271 272 273 274 275 | 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 | - + - + + + + - + + + | (tt-handler-set! ttdat (handler dbstruct)) (let* ((tcp-thread (make-thread (lambda () (tt:start-tcp-server ttdat)) ;; start the tcp-server which applies handler to incoming data "tcp-server-thread")) (run-thread (make-thread (lambda () |
︙ |