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

[Netty 5] DefaultChannelPromise / DefaultPromise threading #8517

Closed
normanmaurer opened this issue Nov 13, 2018 · 3 comments
Closed

[Netty 5] DefaultChannelPromise / DefaultPromise threading #8517

normanmaurer opened this issue Nov 13, 2018 · 3 comments
Assignees
Projects

Comments

@normanmaurer
Copy link
Member

DefaultPromise requires an EventExecutor which provides the thread to notify listeners on. DefaultPromise currently accounts for the EventExecutor being able to change during its lifetime. This complicates the implementation of DefaultPromise and in many cases would violate assumptions of the listeners if the thread did change. If we are able to drop support for Channel deregister/re-register we can remove this complexity and improve the efficiency of this class (which provides the basis for asynchronous events in Netty).

We would like to drop re-registration support which will also simplify promise to not worry about the EventExecutor changing.

@normanmaurer
Copy link
Member Author

This depends on #8513

@normanmaurer normanmaurer added this to To do in Netty 5 via automation Nov 13, 2018
@trustin
Copy link
Member

trustin commented Nov 21, 2018

It'd still be nice if we provide a way to suspend a channel from being handled by its event loop temporarily, so that a user can take the full control of the channel when he or she wants to do something really low-level.

@normanmaurer
Copy link
Member Author

@trustin yep that is the plan... It should just be impossible to change the EventLoop but register / deregister / register on the same EventLoop should be possible. When saying register / deregister I am talking about handling IO, eventLoop() should always return the EventLoop tho.

@normanmaurer normanmaurer self-assigned this Apr 1, 2019
@normanmaurer normanmaurer moved this from To do to In progress in Netty 5 Apr 1, 2019
normanmaurer added a commit that referenced this issue Apr 1, 2019
Motivation:

DefaultPromise requires an EventExecutor which provides the thread to notify listeners on and this EventExecutor can never change. We can remove the code that supported the possibility of a changing the executor as this is not possible anymore.

Modifications:

- Remove constructor which allowed to construct a *Promise without an EventExecutor
- Remove extra state
- Adjusted SslHandler and ProxyHandler for new code

Result:

Fixes #8517.
normanmaurer added a commit that referenced this issue Apr 2, 2019
Motivation:

DefaultPromise requires an EventExecutor which provides the thread to notify listeners on and this EventExecutor can never change. We can remove the code that supported the possibility of a changing the executor as this is not possible anymore.

Modifications:

- Remove constructor which allowed to construct a *Promise without an EventExecutor
- Remove extra state
- Adjusted SslHandler and ProxyHandler for new code

Result:

Fixes #8517.
normanmaurer added a commit that referenced this issue Apr 2, 2019
Motivation:

DefaultPromise requires an EventExecutor which provides the thread to notify listeners on and this EventExecutor can never change. We can remove the code that supported the possibility of a changing the executor as this is not possible anymore.

Modifications:

- Remove constructor which allowed to construct a *Promise without an EventExecutor
- Remove extra state
- Adjusted SslHandler and ProxyHandler for new code

Result:

Fixes #8517.
normanmaurer added a commit that referenced this issue Apr 3, 2019
…se (#8996)

Motivation:

DefaultPromise requires an EventExecutor which provides the thread to notify listeners on and this EventExecutor can never change. We can remove the code that supported the possibility of a changing the executor as this is not possible anymore.

Modifications:

- Remove constructor which allowed to construct a *Promise without an EventExecutor
- Remove extra state
- Adjusted SslHandler and ProxyHandler for new code

Result:

Fixes #8517.
Netty 5 automation moved this from In progress to Done Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Netty 5
  
Done
Development

No branches or pull requests

2 participants