Re: Executing Future

2011-04-28 Thread Paul deGrandis
Another great resource for Clojure is ClojureDocs. The doc for 'future' has a simple example: http://clojuredocs.org/clojure_core/clojure.core/future Not only does it show you the doc string and an example, if your scroll down you can see the source code for the function. You'll see that lot of

Re: Executing Future

2011-04-28 Thread Jonathan Fischer Friberg
"So I have this question. I have heard that Clojure's data structures are immutable and it has support for promises, agents, atoms etc." It's not that clojure's data structures support promises, agents ... It's more like promises, agents ... support clojure's data structures. "Changing" something

Re: Executing Future

2011-04-28 Thread MohanR
The problem was elsewhere but I realized that Clojure has support for futures at the level of the language even though it relies on java.util.concurrent. So I have this question. I have heard that Clojure's data structures are immutable and it has support for promises, agents, atoms etc. What exa

Re: Executing Future

2011-04-25 Thread gaz jones
the easiest way (i find) to test if something occurring on another thread has completed is using a latch: (deftest mohanr (let [latch (CountDownLatch. 1) service (Executors/newFixedThreadPool 10)] (doseq [x (range 1) :let [f (.submit service (

Executing Future

2011-04-25 Thread MohanR
( deftest teststream (def service ( Executors/newFixedThreadPool 10 )) (dotimes [x 1] (try (def futures (.submit service ( proxy [Callable][] ( call [] ( println "Test" )