-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Support reuse current eventLoop for Deployment #5353
base: master
Are you sure you want to change the base?
Conversation
* Tasks are scheduled on the current event-loop thread. | ||
*/ | ||
CURRENT_EVENT_LOOP, | ||
|
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.
current event loop is not a threading model
I think we should find another way to provide this, e.g. a deployment option boolean that says to reuse the current event loop or something else |
I think this is a good idea.let me try |
…er to reuse the current EventLoop instead of using the ThreadModel.
I have reimplemented it according to your idea. Please take a look again. |
@dreamlike-ocean thanks I am still wondering if that should not be done diffently using a deployment builder like structure that would allow to pass a context explicitely instead |
What if it is implemented using a special verticle type? For example, we can provide an “abstract class ResuseEventLoopVerticle extends AbstractVerticle” type? |
add new ThreadingModel to support reuse current eventLoop for deploying verticle
Motivation:
Sometimes we expect to deploy child verticles using the current EventLoop. This can ensure the affinity between multiple child verticles and the parent verticle.
Moreover, when deploying a large number of verticles, if the current EventLoop cannot be reused, it will generate a large amount of system call overhead caused by selector::wakeup.
directly deploy verticle:
reuse eventLoop for deploying verticle
So I provided a new ThreadingModel enum and made some compatibility. When creating an eventLoopContext, the EventLoop corresponding to the current Context will be used as the EventLoop of the new eventLoopContext.
Conformance:
I have signed Eclipse Contributor Agreement.