💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 组件源码 ``` /** * <b>方法描述:</b> 初始化线程池 <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2020-12-18 16:09:18 <br/> * * @param corePoolSize * 入参|核心线程数(默认5)|{@link int} * @param maxPoolSize * 入参|最大线程数(默认200)|{@link int} * @param queue * 入参|队列(默认50)|{@link int} * @param aliveTime * 入参|超时时间(单位:秒)|{@link int} * @param allowCoreThreadTimeOut * 入参|核心线程超时关闭(默认false)|{@link boolean} * @return 1 成功<br/> */ @Component(label = "初始化线程池", style = "判断型", type = "同步组件", comment = "该组件在平台内初始构建一个线程池,如果重复调用,不会重复构建,只会重设线程池大小参数。", version = "1.0.0", deprecated = false, author = "admin", date = "2020-12-18 04:09:18") @InParams(param = {@Param(name = "corePoolSize", comment = "核心线程数(默认5)", type = int.class), @Param(name = "maxPoolSize", comment = "最大线程数(默认200)", type = int.class), @Param(name = "queue", comment = "队列(默认50)", type = int.class), @Param(name = "aliveTime", comment = "超时时间(单位:秒)", type = int.class), @Param(name = "allowCoreThreadTimeOut", comment = "核心线程超时关闭(默认false)", type = boolean.class)}) @Returns(returns = {@Return(id = "1", desp = "成功")}) @Order(value = 2) public static ResultBase P_initPool(int corePoolSize, int maxPoolSize, int queue, int aliveTime, boolean allowCoreThreadTimeOut) { ThreadPoolUtils.initPool(corePoolSize, maxPoolSize, queue, aliveTime, allowCoreThreadTimeOut); return ResultBase.newSuccessResult(); } ``` # 交易中组件使用方式 ![](https://img.kancloud.cn/6e/97/6e9771f62c8d0524910325debbc21b96_1869x868.png) # 参数说明及示例 ## 入口参数 核心线程数(默认5):核心线程大小,示例: `5` 最大线程数(默认200):最大线程大小:示例: `50` 队列(默认50):任务队列,示例: `30` 超时时间(单位:秒):超过corePoolSize的线程多久不活动被销毁时间,示例: `60` 核心线程超时关闭(默认false):设置核心线程超时关闭,示例: `true`