public interface EventLoopGroupProvider
EventLoopGroups and EventExecutorGroups. A event loop group is a heavy-weight instance
holding and providing Thread instances. Multiple instances can be created but are expensive. Keeping too many
instances open can exhaust the number of open files.
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.
The EventLoopGroupProvider allows to allocate and release instances implementing EventExecutorGroup. The
EventExecutorGroup instances must not be terminated or shutdown by the user. Resources are managed by the particular
EventLoopGroupProvider.
EventLoopGroupProvider to share existing EventLoopGroup's with
lettuce.| Modifier and Type | Method and Description |
|---|---|
<T extends EventLoopGroup> |
allocate(Class<T> type)
|
Future<Boolean> |
release(EventExecutorGroup eventLoopGroup,
long quietPeriod,
long timeout,
TimeUnit unit)
Release a
eventLoopGroup instance. |
Future<Boolean> |
shutdown(long quietPeriod,
long timeout,
TimeUnit timeUnit)
Shutdown the provider and release all instances.
|
int |
threadPoolSize()
Returns the pool size (number of threads) for IO threads.
|
<T extends EventLoopGroup> T allocate(Class<T> type)
EventLoopGroup for the channel type. Do not terminate or shutdown the
instance. Call the release(EventExecutorGroup, long, long, TimeUnit) to release an individual instance or
shutdown(long, long, TimeUnit) method to free the all resources.T - type of the EventLoopGrouptype - class of the EventLoopGroup, must not be nullEventLoopGroup.int threadPoolSize()
Future<Boolean> release(EventExecutorGroup eventLoopGroup, long quietPeriod, long timeout, TimeUnit unit)
eventLoopGroup instance. The method will shutdown/terminate the EventExecutorGroup if it is no longer
needed.eventLoopGroup - the eventLoopGroup instance, must not be nullquietPeriod - the quiet periodtimeout - the timeoutunit - time unit for the quiet period/the timeoutFuture<Boolean> shutdown(long quietPeriod, long timeout, TimeUnit timeUnit)
quietPeriod - the quiet periodtimeout - the timeouttimeUnit - the unit of quietPeriod and timeoutCopyright © 2019 lettuce.io. All rights reserved.