Re: Why does (send a f) hang in this code, if f returns an agent?

2012-06-08 Thread Stuart Sierra
I'm not sure why it hangs, but my guess is that your actions are throwing exceptions, breaking the loop and preventing the SynchronousQueue from ever being filled. By the way, the `time` you're measuring will dominated by `pprint`, not your actual test. -S -- You received this message

Why does (send a f) hang in this code, if f returns an agent?

2012-05-26 Thread Alex Coventry
I was messing with the example at clojure.org/agents to get it to log which agents called which, and finally came up with (use 'clojure.pprint) (defn relay [x i agidx] (when (:next x) (send (:next x) relay i (:idx x))) (when (and (zero? i) (:report-queue x)) (.put