[#5455] Clarify ChannelPool javadocs

Motivation:

We should make it clear that each acquired Channel needs to be released in all cases.

Modifications:

More clear javadocs.

Result:

Harder for users to leak Channel.
This commit is contained in:
Norman Maurer 2016-07-04 09:40:08 +02:00
parent 195d7476d5
commit c393374cf5

View File

@ -29,12 +29,18 @@ public interface ChannelPool extends Closeable {
/**
* Acquire a {@link Channel} from this {@link ChannelPool}. The returned {@link Future} is notified once
* the acquire is successful and failed otherwise.
*
* <strong>Its important that an acquired is always released to the pool again, even if the {@link Channel}
* is explicitly closed..</strong>
*/
Future<Channel> acquire();
/**
* Acquire a {@link Channel} from this {@link ChannelPool}. The given {@link Promise} is notified once
* the acquire is successful and failed otherwise.
*
* <strong>Its important that an acquired is always released to the pool again, even if the {@link Channel}
* is explicitly closed..</strong>
*/
Future<Channel> acquire(Promise<Channel> promise);