Hi,

On Sun, Oct 18, 2009 at 6:27 AM, mbrodersen <morten.broder...@gmail.com>wrote:

>
> I don't know SWT well enough to answer that. I am new to the JVM
> platform (after 20+ years of writing native C++ code).
>
> However, the question is not SWT specific. There will be other cases
> (for example OpenGL) where something like InvokeLater doesn't exist.
>


Agents aren't tied to thread pools, actions are (send and send-off).
Are agents really the right thing for you? Do you care about the value of
the agent?

In such a case a good old Executor or ExecutorService seems fine (at the
price of java interop -- nothing that a quick macro can't alleviate):

(def #^ExecutorService e (Executors/newFixedThreadPool 1))
(.execute e #(your code here)) ; if you don't care about the return value or
when it is executed
(.submit e #^Callable #(your code here)) ; else

Christophe

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to