Getting a bit confused again. It seems possible to make counters from
agents, atoms and refs

(def countagent (agent 0))
(send agent inc)

(def countatom (atom 0))
(swap! atom inc)

(def countref  (ref 0))
(dosync (commute countref inc))

Is there a time and place for all three of them? I am leaning towards
always using the agent, as it can be send from transactions when the
transaction finishes.

On that note, agents are not retried, right? They just get queued and
eventually happen. So I could also put a countagent inside another
agent and be sure that it get only added once?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to