Commits

carl douglas  committed 7b80029

Added redis-transaction procedure to discard queued redis messages in case of exception.

  • Participants
  • Parent commits bf4d368

Comments (0)

Files changed (1)

File redis-client.scm

                    (else (error "unrecognised prefix" ch )))))))
     (prefix)))
 
+(define-syntax redis-transaction
+  (ir-macro-transformer
+    (lambda (x i c)
+      `(handle-exceptions
+         exn
+        (begin
+          (redis-discard)
+          (abort exn))
+        (redis-multi)
+        ,@(cdr x)
+        (redis-exec)))))
+ 
 (define-syntax map-make-redis-parameter-function
   (ir-macro-transformer
     (lambda (x i c)