Agents are similar to Atoms, except for the fact that changes are made asynchronously. Unlike an Atom, when attempted changes to an Agent fail, you won't know until you check. This is because changes to an Agent happen in a different thread, so the thread trying to make the change won't be aware of anything going on in the Agent.
You create an Agent the same way you would create an Atom, except that, in this case, you'll use the
agent form, as shown in the following code snippet:
user> (def -ag (agent )) #'user/-ag
We need to create a function that'll show us the current state of the
-ag agent, as shown in the following code snippet:
user> (defn show-agent  (dotimes [_ 6] (Thread/sleep 1000) (println “Slept for" _ “second(s).\n" “-ag = ...