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

Added writeVoidPromise, writeAndFlushVoidPromise to ChannelGroup - Issue #3127 #4478

Closed
wants to merge 1 commit into from

Conversation

Mr00Anderson
Copy link
Contributor

Added writeVoidPromise, writeAndFlushVoidPromise methods to ChannelGroup and DefaultChannelGroup

Motivation:

Reduce Objects and GC by option. Give the option to developers to be able to choose to Channel.voidPromise() when making group writes. This will reduce object creation for ChannelGroup writes and writeAndFlush's by adding additional methods which add the Channel.voidPromise() into the Channel.write() portion of the method.

Modifications:

ChannelGroup.class - Added new methods to the interface along with documentation to the regular method and addition documentation specificly the purpose of the new methods.

ChannelGroupFuture writeVoidPromise(Object message);
ChannelGroupFuture writeAndFlushVoidPromise(Object message);
ChannelGroupFuture writeVoidPromise(Object message, ChannelMatcher matcher);
ChannelGroupFuture writeAndFlushVoidPromise(Object message, ChannelMatcher matcher);.

DefaultChannelGroup.class - Now implements these new interface methods in the utilizing the existing write and writeAndFlush method by coping them and then adding Channel.voidPromise() to the two methods that actually have the write logic.

public ChannelGroupFuture writeVoidPromise(Object message);
public ChannelGroupFuture writeAndFlushVoidPromise(Object message);
public ChannelGroupFuture writeVoidPromise(Object message, ChannelMatcher matcher);
public ChannelGroupFuture writeAndFlushVoidPromise(Object message, ChannelMatcher matcher);

Result:

Netty.io API users will now be able to use DefaultChannelGroup.writeVoidPromise(); and DefaultChannelGroup.writeAndFlushVoidPromise();, and be able to save on object creation and GC when not caring about the FuturePromise.

closes #3127

…oup and DefaultChannelGroup

Motivation:

Reduce Objects and GC by option. Give the option to developers to be able to choose to Channel.voidPromise() when making group writes. This will reduce object creation for ChannelGroup writes and writeAndFlush's by adding additional methods which add the Channel.voidPromise() into the Channel.write() portion of the method.

Modifications:

* ChannelGroup.class - Added new methods to the interface along with documentation to the regular method and addition documentation specificly the purpose of the new methods. ChannelGroupFuture writeVoidPromise(Object message);, ChannelGroupFuture writeVoidPromise(Object message, ChannelMatcher matcher);, ChannelGroupFuture writeAndFlushVoidPromise(Object message);, ChannelGroupFuture writeAndFlushVoidPromise(Object message);.
* DefaultChannelGroup now implements these new interface methods in the utilizing the existing write and writeAndFlush method by coping them and then adding Channel.voidPromise() to the two methods that actually have the write logic - public ChannelGroupFuture writeVoidPromise(Object message, ChannelMatcher matcher)  and  public ChannelGroupFuture writeAndFlushVoidPromise(Object message, ChannelMatcher matcher).

Result:

Netty.io API users will now be able to use DefaultChannelGroup.writeVoidPromise() and DefaultChannelGroup.writeAndFlushVoidPromise();, and be able to save on object creation and GC when not caring about the FuturePromise.

closes #3127
@Mr00Anderson
Copy link
Contributor Author

@normanmaurer if i need to change the method naming let me know.

@normanmaurer
Copy link
Member

@Underbalanced let me think about it a bit.

@normanmaurer normanmaurer self-assigned this Nov 23, 2015
@normanmaurer
Copy link
Member

@trustin WDYT ?

@trustin
Copy link
Member

trustin commented Mar 23, 2016

Sounds like a reasonable request. However, the method names need rework.
Obviously we do not write 'void promise' :-)

How about writeWithVoidPromise?

@Mr00Anderson
Copy link
Contributor Author

Ha. I am new to community projects contributions. I also am terrible with
wording as I find my self constantly correcting verbiages in my Java
Libraries!

On Wed, Mar 23, 2016 at 4:57 AM, Trustin Lee notifications@github.com
wrote:

Sounds like a reasonable request. However, the method names need rework.
Obviously we do not write 'void promise' :-)

How about writeWithVoidPromise?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#4478 (comment)

@trustin
Copy link
Member

trustin commented Mar 24, 2016

@Underbalanced No worries! Thanks a lot for proposing a great idea. :-)

@normanmaurer
Copy link
Member

Let me take over this with some slightly changes. @Underbalanced thanks for the idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

voidPromise() - ChannelGroups
4 participants