Changes for clojure.core/shutdown-agents

taylor.sando on Sun, 07 Oct 2012
;; Creating an agent
user> (def a (agent 1))

;; Create a function that can handle an agent

user> (defn agent-action [a]

;; The agent will become 33
user> (send-off a agent-action)
#<Agent@dde4f2: 33>

user> @a
;; Create another agent before shutdown
user> (def c (agent 3))

;; Shutdown agents is called
user> (shutdown-agents)

;; Attempt to turn c into 33
user> (send c agent-action)
#<Agent@b162fa: 3>

;; The result is that it is still the same value it was initialized with
user> @c

;; Agent created after shutdown
user> (def d (agent 4))

;; Try sending it
user> (send d agent-action)
#<Agent@356519: 4>

;; Same thing, there are no threads to process the agents
user> @d