On Mar 6, 3:23 pm, Mark Volkmann <r.mark.volkm...@gmail.com> wrote:
> The code below gives java.lang.IllegalArgumentException: More than one
> matching method found: submit. Is there a way to tell Clojure which
> submit method I want?
>
> (defn do-stuff []
>   (+ 2 2))
>
> (let [executor (java.util.concurrent.Executors/newSingleThreadExecutor)
>       future (.submit executor #(do-stuff))]
>   (println (.get future)))


(let [executor (java.util.concurrent.Executors/
newSingleThreadExecutor)
       future (.submit executor #^Callable #(do-stuff))]
   (println (.get future)))

==> 4

Cheers, Jason
--~--~---------~--~----~------------~-------~--~----~
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