view src/main/java/christie/codegear/StartCodeGear.java @ 1:3ea61d0bfc34

add dependency proccess but not work
author Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
date Mon, 11 Dec 2017 21:19:25 +0900
parents
children bacdcb5e6dcf
line wrap: on
line source

package christie.codegear;

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

public interface StartCodeGear {
    default CodeGearManager createCodeGearManager(ThreadPoolExecutor exe){
        return new CodeGearManager(exe);
    }

    default ThreadPoolExecutor createThreadPool(){
        return new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), // initial number of threads
                Runtime.getRuntime().availableProcessors(),
                Integer.MAX_VALUE, // keepAliveTime
                TimeUnit.SECONDS,
                new LinkedBlockingQueue<Runnable>());
    }
}