How can I see the number of rollbacks in my STM in Clojure? -
how can see number of rollbacks in stm in clojure?
you can't... unless willing cheat:
(defmacro spy-dosync [& body] `(let [retries# (atom -1) result# (dosync (swap! retries# inc) ~@body)] (println "retries count:" @retries#) result#))
and replace dosync spy-dosync.
Comments
Post a Comment