Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #1122] support custom asyncThreadPool #1194

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,13 @@ public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
}
return asyncThreadPool;
}

/**
* 设置callback用的线程池
*
* @param asyncThreadPool callback用的线程池
*/
public static void setAsyncThreadPool(ThreadPoolExecutor asyncThreadPool) {
AsyncRuntime.asyncThreadPool = asyncThreadPool;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to consider a more reasonable configuration for supporting asynchronous thread pool setups. The changes here do not guarantee thread safety and do not ensure that no other logic will have access to the thread pool created by the original logic before the set method is called. I hope to have a modified solution to discuss before putting it into development.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to consider a more reasonable configuration for supporting asynchronous thread pool setups. The changes here do not guarantee thread safety and do not ensure that no other logic will have access to the thread pool created by the original logic before the set method is called. I hope to have a modified solution to discuss before putting it into development.

sorry, I will follow the steps.

}
}