On Wed, 2009-06-10 at 12:44 -0600, Daniel Lyons wrote: > However, I still feel like I am not understanding when agents should > be used or what an appropriate use of them would constitute, though.
Well, since agents run independently and asynchronously I found them to be most useful when you have multiple independent activities going on without too much synchronization. For example you could model stateful connections as agents which undergo state transitions based on incoming packages (or think event-based systems). The general concept is similar to the actor model (cf. http://en.wikipedia.org/wiki/Actor_model) but non-distributed, i.e. all actors run within a single JVM process. For better understanding maybe just contrast agents to refs which allow synchronous updates of shared state. There used to be a diagram in the file section of the group which showed the different concurrency primitives with respect to the two dimensions dependent/independent and synchronous/asynchronous. Hope this helps. Cheers, Toralf --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---