package com.xunwang.education.util;

import java.util.concurrent.*;

public class ThreadPoolUtil {

    private static int corePoolSize = 8;

    private static int maxPoolSize = 12;

    private static int keepAliveTime = 120;


    public static ThreadPoolExecutor getThreadPool() {
        return new ThreadPoolExecutor(corePoolSize, maxPoolSize, keepAliveTime, TimeUnit.SECONDS,
                new LinkedBlockingQueue<>(30), Executors.defaultThreadFactory(), new ThreadPoolExecutor.AbortPolicy());
    }

}
