Mall - a simple tool thread threading tools
Defined Threading Tools
package com.leyou.utils;
import java.util.concurrent.*;
/**
* @Feature: 线程工具
*/
public class ThreadUtils {
private static final ExecutorService es = Executors.newFixedThreadPool(10);
public static void execute(Runnable runnable){
es.submit(runnable);
}
}
Thread Tools calls
/**
* 新建线程处理页面静态化
* @param spuId
*/
@Override
public void asyncExecute(Long spuId) {
ThreadUtils.execute(() ->createHtml(spuId));
}