List of usage examples for io.netty.util.concurrent EventExecutorGroup iterator
@Override Iterator<EventExecutor> iterator();
From source file:com.lambdaworks.redis.resource.DefaultClientResourcesTest.java
License:Apache License
@Test public void testBuilder() throws Exception { DefaultClientResources sut = new DefaultClientResources.Builder().ioThreadPoolSize(4) .computationThreadPoolSize(4) .commandLatencyCollectorOptions(DefaultCommandLatencyCollectorOptions.disabled()).build(); EventExecutorGroup eventExecutors = sut.eventExecutorGroup(); NioEventLoopGroup eventLoopGroup = sut.eventLoopGroupProvider().allocate(NioEventLoopGroup.class); assertThat(eventExecutors.iterator()).hasSize(4); assertThat(eventLoopGroup.executorCount()).isEqualTo(4); assertThat(sut.ioThreadPoolSize()).isEqualTo(4); assertThat(sut.commandLatencyCollector()).isNotNull(); assertThat(sut.commandLatencyCollector().isEnabled()).isFalse(); assertThat(sut.shutdown(0, 0, TimeUnit.MILLISECONDS).get()).isTrue(); }
From source file:com.lambdaworks.redis.resource.DefaultClientResourcesTest.java
License:Apache License
@Test public void testSmallPoolSize() throws Exception { DefaultClientResources sut = new DefaultClientResources.Builder().ioThreadPoolSize(1) .computationThreadPoolSize(1).build(); EventExecutorGroup eventExecutors = sut.eventExecutorGroup(); NioEventLoopGroup eventLoopGroup = sut.eventLoopGroupProvider().allocate(NioEventLoopGroup.class); assertThat(eventExecutors.iterator()).hasSize(3); assertThat(eventLoopGroup.executorCount()).isEqualTo(3); assertThat(sut.ioThreadPoolSize()).isEqualTo(3); assertThat(sut.shutdown(0, 0, TimeUnit.MILLISECONDS).get()).isTrue(); }
From source file:io.lettuce.core.resource.DefaultClientResourcesTest.java
License:Apache License
@Test public void testBuilder() throws Exception { DefaultClientResources sut = DefaultClientResources.builder().ioThreadPoolSize(4) .computationThreadPoolSize(4) .commandLatencyCollectorOptions(DefaultCommandLatencyCollectorOptions.disabled()).build(); EventExecutorGroup eventExecutors = sut.eventExecutorGroup(); NioEventLoopGroup eventLoopGroup = sut.eventLoopGroupProvider().allocate(NioEventLoopGroup.class); assertThat(eventExecutors.iterator()).hasSize(4); assertThat(eventLoopGroup.executorCount()).isEqualTo(4); assertThat(sut.ioThreadPoolSize()).isEqualTo(4); assertThat(sut.commandLatencyCollector()).isNotNull(); assertThat(sut.commandLatencyCollector().isEnabled()).isFalse(); assertThat(sut.shutdown(0, 0, TimeUnit.MILLISECONDS).get()).isTrue(); }
From source file:io.lettuce.core.resource.DefaultClientResourcesTest.java
License:Apache License
@Test public void testSmallPoolSize() throws Exception { DefaultClientResources sut = DefaultClientResources.builder().ioThreadPoolSize(1) .computationThreadPoolSize(1).build(); EventExecutorGroup eventExecutors = sut.eventExecutorGroup(); NioEventLoopGroup eventLoopGroup = sut.eventLoopGroupProvider().allocate(NioEventLoopGroup.class); assertThat(eventExecutors.iterator()).hasSize(3); assertThat(eventLoopGroup.executorCount()).isEqualTo(3); assertThat(sut.ioThreadPoolSize()).isEqualTo(3); assertThat(sut.shutdown(0, 0, TimeUnit.MILLISECONDS).get()).isTrue(); }