|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgpars.ParallelEnhancer
class ParallelEnhancer
ParallelEnhancer allows classes or instances to be enhanced with parallel variants of iterative methods, like eachParallel(), collectParallel(), findAllParallel() and others. These operations split processing into multiple concurrently executable tasks and perform them on the underlying instance of the ForkJoinPool class from JSR-166y. The pool itself is stored in a final property threadPool and can be managed through static methods on the ParallelEnhancer class. All enhanced classes and instances will share the underlying pool. Use the getThreadPool() method to get hold of the thread pool.
Constructor Summary | |
ParallelEnhancer()
|
Method Summary | |
---|---|
static void
|
enhanceClass(Class clazz)
Enhances a class and so all instances created in the future by mixing-in an instance of Parallel. |
static Object
|
enhanceInstance(Object collection)
Enhances a single instance by mixing-in an instance of Parallel. |
static Pool
|
getThreadPool()
Retrieves the underlying pool |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Constructor Detail |
---|
ParallelEnhancer()
Method Detail |
---|
public static void enhanceClass(Class clazz)
public static Object enhanceInstance(Object collection)
public static Pool getThreadPool()
Groovy Documentation