Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
Improve Javadoc of ClientResources and EventLoopGroupProvider.
  • Loading branch information
mp911de committed Jul 2, 2016
1 parent 3ac5a63 commit 97669f3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
Expand Up @@ -51,18 +51,21 @@ public interface ClientResources {
Future<Boolean> shutdown(long quietPeriod, long timeout, TimeUnit timeUnit);

/**
* Return s the {@link EventLoopGroupProvider} which provides access to the particular
* {@link io.netty.channel.EventLoopGroup event loop groups}. lettuce needs at least two implementations:
* {@link io.netty.channel.nio.NioEventLoopGroup} for TCP/IP connections and
* {@link io.netty.channel.epoll.EpollEventLoopGroup} for unix domain socket connections (epoll).
* Returns the {@link EventLoopGroupProvider} that provides access to the particular {@link io.netty.channel.EventLoopGroup
* event loop groups}. lettuce requires at least two implementations: {@link io.netty.channel.nio.NioEventLoopGroup} for
* TCP/IP connections and {@link io.netty.channel.epoll.EpollEventLoopGroup} for unix domain socket connections (epoll).
*
* You can use {@link DefaultEventLoopGroupProvider} as default implementation or implement an own
* {@link EventLoopGroupProvider} to share existing {@link io.netty.channel.EventLoopGroup EventLoopGroup's} with lettuce.
*
* @return the {@link EventLoopGroupProvider} which provides access to the particular
* {@link io.netty.channel.EventLoopGroup event loop groups}
*/
EventLoopGroupProvider eventLoopGroupProvider();

/**
* Returns the computation pool used for internal operations.
* Returns the computation pool used for internal operations. Such tasks are periodic Redis Cluster and Redis Sentinel
* topology updates and scheduling of connection reconnection by {@link com.lambdaworks.redis.protocol.ConnectionWatchdog}.
*
* @return the computation pool used for internal operations
*/
Expand Down
Expand Up @@ -7,31 +7,34 @@
import io.netty.util.concurrent.Future;

/**
* Provider for {@link EventExecutorGroup EventLoopGroups and EventExecutorGroups}. A event loop group is a heavy-weight
* instance holding and providing {@link Thread} instances. Multiple instances can be created but are expensive. Keeping too
* many instances open can exhaust the number of open files.
* Provider for {@link EventLoopGroup EventLoopGroups and EventExecutorGroups}. A event loop group is a heavy-weight instance
* holding and providing {@link Thread} instances. Multiple instances can be created but are expensive. Keeping too many
* instances open can exhaust the number of open files.
* <p>
* Usually, the default settings are sufficient. However, customizing might be useful for some special cases where multiple
* RedisClient or RedisClusterClient instances are needed that share one or more event loop groups.
* {@link com.lambdaworks.redis.RedisClient} or {@link com.lambdaworks.redis.cluster.RedisClusterClient} instances are needed
* that share one or more event loop groups.
* </p>
* <p>
* The {@link EventLoopGroupProvider} allows to allocate and release instances implementing {@link EventExecutorGroup}. The
* {@link EventExecutorGroup} instances must not be terminated or shutdown by the user. Resources are managed by the particular
* {@link EventLoopGroupProvider}.
* </p>
* You can implement your own {@link EventLoopGroupProvider} to share existing {@link EventLoopGroup EventLoopGroup's} with
* lettuce.
*
* @author Mark Paluch
* @since 3.4
*/
public interface EventLoopGroupProvider {

/**
* Retrieve a {@link EventLoopGroup} for the type {@code type}. Do not terminate or shutdown the instance. Call the
* {@link #release(EventExecutorGroup, long, long, TimeUnit)} to release an individual instance or
* Retrieve a {@link EventLoopGroup} for the {@link EventLoopGroup channel} {@code type}. Do not terminate or shutdown the
* instance. Call the {@link #release(EventExecutorGroup, long, long, TimeUnit)} to release an individual instance or
* {@link #shutdown(long, long, TimeUnit)} method to free the all resources.
*
* @param type type of the event loop group, must not be {@literal null}
* @param <T> type parameter
* @param type class of the {@link EventLoopGroup}, must not be {@literal null}
* @param <T> type of the {@link EventLoopGroup}
* @return the {@link EventLoopGroup}.
*/
<T extends EventLoopGroup> T allocate(Class<T> type);
Expand All @@ -45,7 +48,7 @@ public interface EventLoopGroupProvider {
int threadPoolSize();

/**
* Release a {@code eventLoopGroup} instance. The method will shutdown/terminate the event loop group if it is no longer
* Release a {@code eventLoopGroup} instance. The method will shutdown/terminate the {@link EventExecutorGroup} if it is no longer
* needed.
*
* @param eventLoopGroup the eventLoopGroup instance, must not be {@literal null}
Expand Down

0 comments on commit 97669f3

Please sign in to comment.