Dispatch an action to an agent. Returns the agent immediately.
Subsequently, in a thread from a thread pool, the state of the agent
will be set to the value of:
(apply action-fn state-of-agent args)
user=>(defmy-agent(agent100))#'user/my-agentuser=>@my-agent100;; Note the following happens asynchronously in a thread;; pooluser=>(sendmy-agent+100)#<Agent@5afc0f5:200>;; Assuming the addition has completed the value will;; now be updated when we look at it.user=>@my-agent200
;; update agent valueuser=>(deffoo(agent100))#'user/my-agentuser=>@foo100;; function get "old value"user=>(sendfoo(fn[old-foo](printlnold-foo"foo will change")(+old-foo100)))100foowillchange#agent[{:status:ready,:val200}0x000000]user=>@foo200