* @see ERXTaskThread
* @see ERXExecutorService
*
*/
public class ERXExecutorService {
private static final ExecutorService _executorService = new ERXTaskThreadPoolExecutor(0, Integer.MAX_VALUE, 60L,
TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), new ERXTaskThreadFactory());
/**
* @return a global ExecutorService with no limit for executing runnables.
**/
public static ExecutorService executorService() {
return _executorService;
}
/**
* This ExecutorService is useful when you want to execute tasks in parallel, but you want to (create and)
* submit new tasks for execution only when the pool has at least one idle thread.
*
* A task will be rejected with a {@link RejectedExecutionException} when all the threads are busy