what does release-pending-sends do?

2015-05-31 Thread lawrence
I am looking here: http://clojuredocs.org/clojure.core/release-pending-sends It says: Normally, actions sent directly or indirectly during another action are held until the action completes (changes the agent's state). This function can be used to dispatch any pending sent actions

Re: what does release-pending-sends do?

2015-05-31 Thread James Reeves
What it means is if you have nested actions, e.g. (def a (agent 0)) (def b (agent 0)) (send a (fn [x] (send b inc) (inc x))) So under normal circumstances, the inner send is placed on a queue until the value of a is changed. This means we can guarantee that a will change before b.