Skip to content

Commit 415467f

Browse files
author
夜色
committed
修改EventBus使用非固定线程池
1 parent 65f3c52 commit 415467f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mpush-tools/src/main/java/com/mpush/tools/thread/pool/DefaultExecutorFactory.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ public Executor get(String name) {
8383
break;
8484
case EVENT_BUS:
8585
config = ThreadPoolConfig
86-
.buildFixed(T_EVENT_BUS,
87-
CC.mp.thread.pool.event_bus.min,
88-
CC.mp.thread.pool.event_bus.queue_size
89-
);
86+
.build(T_EVENT_BUS)
87+
.setCorePoolSize(CC.mp.thread.pool.event_bus.min)
88+
.setMaxPoolSize(CC.mp.thread.pool.event_bus.max)
89+
.setKeepAliveSeconds(TimeUnit.SECONDS.toSeconds(10))
90+
.setQueueCapacity(CC.mp.thread.pool.event_bus.queue_size);
9091
break;
9192
case MQ:
9293
config = ThreadPoolConfig

0 commit comments

Comments
 (0)