On 27 July 2011 20:37, Greg Brown <gk_br...@verizon.net> wrote: >>> If you want the sub-tasks to use the same executor service, you can just >>> pass that service instance to the sub-task constructor. If you pass the >>> fixed thread pool service to each of your individual tasks, you will get >>> the behavior you want. >> >> Yes, that is what I discovered. I end up having to tell the task how >> it will be executed when it is created. > > The same is true of any task - you provide the executor service to the > constructor. A TaskGroup or TaskSequence is just a task that executes other > tasks.
Yeah, I understand that, and it is part of the reason that I thought these classes would do something a bit different and that is where their value would come from. > Might it make more sense to pass the executor service to the execute() > method, rather than the constructor? That way, the service can easily be > propagated to the sub-tasks. I think that would certainly add value. For now though, I think I'll end up rolling my own rather than use these, especially as they are not used elsewhere within Pivot. >> But by then I couldn't really see what these classes offer. > > They offer exactly what was described earlier in the thread - a means for > executing a set of tasks in sequence or in parallel. Unfortunately this thread is not referenced in the javadocs :) As this thread's existence proves, the javadocs still left me with questions. I just didn't (and still don't) see much difference between these classes and other utility methods or classes that have been rejected/declined as not offering much that an individual developer couldn't quickly knock up themselves, to their exact specifications. So rightly or wrongly, I was essentially judging these classes with my preconceived notions gained from reading the mailing lists.