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.Tracing to trace Redis commands.DefaultClientResources| Modifier and Type | Interface and Description |
|---|---|
static interface |
ClientResources.Builder
Builder for
ClientResources. |
| Modifier and Type | Method and Description |
|---|---|
static ClientResources.Builder |
builder()
Create a new
ClientResources using default settings. |
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.
|
static ClientResources |
create()
Create a new
ClientResources using default settings. |
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.
|
ClientResources.Builder |
mutate()
Returns a builder to create new
ClientResources whose settings are replicated from the current
ClientResources. |
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. |
SocketAddressResolver |
socketAddressResolver()
Returns the
SocketAddressResolver. |
Timer |
timer()
Returns the
Timer to schedule events. |
Tracing |
tracing()
Returns the
Tracing instance to support tracing of Redis commands. |
static ClientResources create()
ClientResources using default settings.static ClientResources.Builder builder()
ClientResources using default settings.ClientResources.Builder mutate()
ClientResources whose settings are replicated from the current
ClientResources.ClientResources.Builder to create new ClientResources whose settings are replicated from the
current ClientResources.Future<Boolean> shutdown()
ClientResources.Future<Boolean> shutdown(long quietPeriod, long timeout, TimeUnit timeUnit)
ClientResources.quietPeriod - the quiet period as described in the documentation.timeout - the maximum amount of time to wait until the executor is shutdown regardless if a task was submitted
during the quiet period.timeUnit - the unit of quietPeriod and timeout.EventLoopGroupProvider 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 groups.EventExecutorGroup 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 publishing.CommandLatencyCollector commandLatencyCollector()
CommandLatencyCollector.DnsResolver dnsResolver()
DnsResolver.SocketAddressResolver socketAddressResolver()
SocketAddressResolver.Delay reconnectDelay()
Delay for reconnect attempts. May return a different instance on each call.Delay.NettyCustomizer nettyCustomizer()
NettyCustomizer to customize netty components.NettyCustomizer.Copyright © 2021 lettuce.io. All rights reserved.