Java ThreadPoolExecutor createExecutor()

Here you can find the source of createExecutor()

Description

create Executor

License

Open Source License

Declaration

public static ThreadPoolExecutor createExecutor() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class Main {
    public static ThreadPoolExecutor createExecutor() {
        return createExecutor(8, 32);
    }/*  w  w w  .ja  v  a  2  s .c o  m*/

    private static ThreadPoolExecutor createExecutor(int corePoolSize, int maxPoolSize) {
        return new ThreadPoolExecutor(corePoolSize, maxPoolSize, 10, TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(256));
    }
}

Related

  1. createExecutor(final String name, int count, int keepAlive, final boolean isDaemon)
  2. createQueue(final int queueCapacity)
  3. createScheduledThreadPoolExecutor(final int poolSz, final String threadName)
  4. createThreadPoolExecutor(final int queueSize, final String threadName)