使用ThreadPoolExecutor時,我可以使用AsyncTask作爲隊列中的Runnable嗎?或者這是否打破了目的?使用ThreadPoolExecutor和AsyncTask
//A holder for various tasks
private final LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(5);
//Thread Pool Executor
private final ThreadPoolExecutor tpe = new ThreadPoolExecutor(3, 3, 10, TimeUnit.SECONDS, queue);