Skip to content

ChannelOutboundInvoker should support method-chaining #820

@normanmaurer

Description

@normanmaurer

In ChannelOutboundInvoker we have for each operations two versions. One which just return a new ChannelFuture and the other which takes a ChannelFuture and returns one.

I think we can improve this out of two reasons:

  1. Return a ChannelFuture when you actual pass in a ChannelFuture which should be notified once the operation is complete is kind of confusing and also redundant. I see no real benefit of doing so, at worst it confuse the user.
  2. If we would just return the ChannelOutboundInvoker by itself we could support method-chaing to make it more user friendly.

So I propose to change the signature for all methods like mention above.

Example:

public interface ChannelOutboundInvoker {
    ChannelFuture bind(SocketAddress localAddress);
   ....

    ChannelOutboundInvoker bind(SocketAddress localAddress, ChannelFuture future);

I think this also make the contract more explicit.

@trustin WDYT ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions