Artifact 693b1bc0fd3df7c3c39869af03ce11cf8a1bbb11:
- File mockup-cached-writes.scm — part of check-in [4309310007] at 2013-01-30 22:04:00 on branch trunk — Added mockup for cached writes (user: mrwellan, size: 534) [annotate] [blame] [check-ins using]
(define (make-cached-writer the-db) (let ((db the-db) (queue '())) (lambda (cacheable . qry-params) (if cacheable (set! queue (cons qry-params queue)) (begin (print "Starting transaction") (for-each (lambda (queue-item) (print "WRITE to " db ": " queue-item)) (reverse queue)) (print "End transaction") (print "READ from " db ": " qry-params)))))) (define a (make-cached-writer "the db")) (a #t "insert abc") (a #t "insert def") (a #t "insert hij") (a #f "select foo")