public interface ClientResources
ClientResources can be shared amongst multiple client instances if created outside
the client creation. Implementations of ClientResources are stateful and must be shutdown() after they are
no longer in use.
ClientResources provides in particular:
EventLoopGroupProvider to obtain particular EventLoopGroupsEventExecutorGroup to perform internal computation tasksTimer for schedulingEventBus for client event dispatchingEventPublisherOptionsCommandLatencyCollector to collect latency details. Requires the HdrHistogram library.DnsResolver to collect latency details. Requires the LatencyUtils library.Delay.DefaultClientResources| Modifier and Type | Method and Description |
|---|---|
CommandLatencyCollector |
commandLatencyCollector()
Returns the
CommandLatencyCollector. |
EventPublisherOptions |
commandLatencyPublisherOptions()
Returns the
EventPublisherOptions for latency event publishing. |
int |
computationThreadPoolSize()
Returns the pool size (number of threads) for all computation tasks.
|
DnsResolver |
dnsResolver()
Returns the
DnsResolver. |
EventBus |
eventBus()
Returns the event bus used to publish events.
|
EventExecutorGroup |
eventExecutorGroup()
Returns the computation pool used for internal operations.
|
EventLoopGroupProvider |
eventLoopGroupProvider()
Returns the
EventLoopGroupProvider that provides access to the particular event loop groups. lettuce requires at least two implementations: NioEventLoopGroup for
TCP/IP connections and EpollEventLoopGroup for unix domain socket connections (epoll). |
int |
ioThreadPoolSize()
Returns the pool size (number of threads) for IO threads.
|
NettyCustomizer |
nettyCustomizer()
Returns the
NettyCustomizer to customize netty components. |
Delay |
reconnectDelay()
Returns the
Delay for reconnect attempts. |
Future<Boolean> |
shutdown()
Shutdown the
ClientResources. |
Future<Boolean> |
shutdown(long quietPeriod,
long timeout,
TimeUnit timeUnit)
Shutdown the
ClientResources. |
Timer |
timer()
Returns the
Timer to schedule events. |
Future<Boolean> shutdown()
ClientResources.Future<Boolean> shutdown(long quietPeriod, long timeout, TimeUnit timeUnit)
ClientResources.quietPeriod - the quiet period as described in the documentationtimeout - the maximum amount of time to wait until the executor is shutdown regardless if a task was submitted
during the quiet periodtimeUnit - the unit of quietPeriod and timeoutEventLoopGroupProvider eventLoopGroupProvider()
EventLoopGroupProvider that provides access to the particular event loop groups. lettuce requires at least two implementations: NioEventLoopGroup for
TCP/IP connections and EpollEventLoopGroup for unix domain socket connections (epoll).
You can use DefaultEventLoopGroupProvider as default implementation or implement an own
EventLoopGroupProvider to share existing EventLoopGroup's with lettuce.EventLoopGroupProvider which provides access to the particular
event loop groupsEventExecutorGroup eventExecutorGroup()
ConnectionWatchdog.int ioThreadPoolSize()
int computationThreadPoolSize()
Timer timer()
Timer to schedule events. A timer object may run single- or multi-threaded but must be used for
scheduling of short-running jobs only. Long-running jobs should be scheduled and executed using
eventExecutorGroup().EventBus eventBus()
EventPublisherOptions commandLatencyPublisherOptions()
EventPublisherOptions for latency event publishing.EventPublisherOptions for latency event publishingCommandLatencyCollector commandLatencyCollector()
CommandLatencyCollector.DnsResolver dnsResolver()
DnsResolver.Delay reconnectDelay()
Delay for reconnect attempts. May return a different instance on each call.Delay.NettyCustomizer nettyCustomizer()
NettyCustomizer to customize netty components.NettyCustomizer.Copyright © 2018 lettuce.io. All rights reserved.