-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[ISSUE #13822]: separation of responsibilities of client executor and login scheduled executor #13878
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
Merged
Merged
[ISSUE #13822]: separation of responsibilities of client executor and login scheduled executor #13878
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loginScheduledExecutor 是否可以去掉,使用executor即可?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
O(∩_∩)O,我说说我的想法,看看你的意见:
loginScheduledExecutor的原因是loginScheduledExecutor执行的是ScheduledExecutorService#scheduleWithFixedDelay方法,它是一个本地定期执行的定时登录任务,所以我想把它放在一个专用的只有 1 个线程的ScheduledExecutorService线程池中去执行,就像上边将while(true)的忙任务分离出来一样ConfigTransportClient#executor我把它定义的类型是ThreadPoolExecutor,它没有专有的命名,我觉得定位更像是一个在 Client 中较为通用的线程池,就像它现在已经被用作去处理模糊监听的任务了,之后如果有线程池需要的话,可以通过ConfigTransportClient#getExecutor方法获取并复用。如果将loginScheduledExecutor去掉的话,那么需要把ConfigTransportClient#executor定义成ScheduledExecutorService类型,那么它就更像是一个能够执行定时任务的线程池了,但是可能本地启动定时任务的场景好像不是很多There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以,按照你的想法,会清晰明确一些。