Browse files

make atomically macro use exec! instead of exec

  • Loading branch information...
1 parent 616b2a9 commit a7d4f2fac671dcfbaf844bf014d5d40321845690 @wallrat committed May 29, 2012
Showing with 9 additions and 8 deletions.
  1. +9 −8 src/labs/redis/core.clj
View
17 src/labs/redis/core.clj
@@ -285,6 +285,14 @@
;; Transactions
;; Like atomically in redis-clojure
+(defn exec!
+ "EXEC
+Execute all commands issued after MULTI.
+Completes QUEUED futures with results.
+Since Redis version 1.1.95"
+ [^Client db]
+ (.execWithResults db))
+
(defmacro atomically
"Execute all redis commands in body in a MULTI/EXEC. If an exception is thrown the
the transaction will be closed by an DISCARD, and the exception will be rethrown.
@@ -295,19 +303,12 @@ Any exceptions thrown by DISCARD will be ignored."
(try
(do
~@body
- (exec ~db))
+ (exec! ~db))
(catch Throwable e#
;; on DISCARD we .ensure to flush the pipeline
(try @(discard ~db)
(finally (throw e#)))))))
-(defn exec!
- "EXEC
-Execute all commands issued after MULTI.
-Completes QUEUED futures with results.
-Since Redis version 1.1.95"
- [^Client db]
- (.execWithResults db))
;; info helper
(defn info!

0 comments on commit a7d4f2f

Please sign in to comment.