I'd like to implement a processing queue in which I'll asynchronously
drop events (represented by, say, a structmap) onto a queue, and
retrieve the results later.

One possible approach to this could be using an agent to store the
results (the agent's controlled state is a collection of results from
previously processed events), and letting the agent's natural queueing
when receiving near-simultaneous send/send-offs be my queue of new to-
be-processed events. The function that I would have each send/send-off
apply to the agent would process my structmap "event" and replace the
agent's state with a new collection that contains the new result.

Are there any gotchas with this approach - specifically with utilizing
the agent's queueing (looks like a controlled-access ArrayList under
the hood) and thread management as my event dispathcer, rather than
getting into something more traditional like the Executor framework?
I'm hoping that this is a kosher usage model...

thanks,
Greg
--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to