Having worked with both Groovy, (J)Ruby and, Java and (to a much smaller degree) Clojure, I can pretty easily claim that ColdFusion's threading and distributed processing capabilities.. leave a little to be desired. (Okay, actually a whole lot).
But sometimes you just want to take an array of values and run them through some sort of processing in a threaded manner, without having to jump onto any other projects or infrastructures, and without having to write that nasty
<cfthread> create and join pattern for the millionth time.
So I wrote a quick CFC I've called 'FutureThreadedWorker', which does exactly that, without half the code you would otherwise need. (Note: this was written for ColdFusion 9. It would be a bit nicer if I could use closures)
//create, passing in an array for the array of structures (which are the arguments passed to the workerMethod)
//then pass it the worker to call the worker method on
//tell it how many thread it's should use
//finally, tell it the name of the method to invoke.
var future = new services.util.FutureThreadedWorker(queue, this, 5, "doWork");
//start the running
//if I want the results, wait for them.
var results = future.get();
//if i want to check for errors
var errors = resuls.getErrors();
Bam. That's it. The FutureThreadedWorker now loops around the passed in array, and passed in the arguments to the method specified on the worker without you having to worry about creating threads or joining them back up again. I think you'll find that a lot easier than using