AlexPeake (69) [Avatar] Offline
#1
(dosync
(send agent-one log-message args-one)
(send-off agent-two send-message-on-queue args-two)
(alter a-ref ref-function)
(some-pure-function args-three))

Clojure’s STM transaction hold all actions that need to be sent to agents until they succeed. In the pseudo-code above, write-to-database and send-message-on-queue are actions that will only be sent when the transaction succeeds. This ensures that even if the transaction is tried multiple times, the side effect causing actions only get sent once.


...sent to agents until the transaction succeeds...


In the pseudo-code above, write-to-database

You should either change the text to log-message or else change the pseudo code to write-to-database