From 5fcb0998cfd50fbf9649ff326acf787a0b9e3156 Mon Sep 17 00:00:00 2001 From: hailang Date: Sat, 16 Apr 2022 08:15:30 +0800 Subject: [PATCH] [ISSUE #1122] support custom `asyncThreadPool` --- .../java/com/alipay/sofa/rpc/context/AsyncRuntime.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/api/src/main/java/com/alipay/sofa/rpc/context/AsyncRuntime.java b/core/api/src/main/java/com/alipay/sofa/rpc/context/AsyncRuntime.java index a5970bf3c..0a6bb801e 100644 --- a/core/api/src/main/java/com/alipay/sofa/rpc/context/AsyncRuntime.java +++ b/core/api/src/main/java/com/alipay/sofa/rpc/context/AsyncRuntime.java @@ -100,4 +100,13 @@ public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { } return asyncThreadPool; } + + /** + * 设置callback用的线程池 + * + * @param threadPoolExecutor callback用的线程池 + */ + public static void setAsyncThreadPool(ThreadPoolExecutor threadPoolExecutor) { + AsyncRuntime.asyncThreadPool = threadPoolExecutor; + } }