This commit is contained in:
Redkale
2018-07-13 23:11:36 +08:00
parent 6d135efbc6
commit 511a966ce5

View File

@@ -39,7 +39,7 @@ public abstract class PoolTcpSource extends PoolSource<AsyncConnection> {
this.bufferPool = bufferPool; this.bufferPool = bufferPool;
this.executor = executor; this.executor = executor;
try { try {
this.group = AsynchronousChannelGroup.withCachedThreadPool(executor, executor.getCorePoolSize()); this.group = AsynchronousChannelGroup.withFixedThreadPool(executor.getCorePoolSize(), executor.getThreadFactory());
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
@@ -121,7 +121,7 @@ public abstract class PoolTcpSource extends PoolSource<AsyncConnection> {
t.printStackTrace(); t.printStackTrace();
return null; return null;
} }
}).thenCompose((conn2) -> { }, executor).thenCompose((conn2) -> {
if (conn2 != null && conn2.isOpen()) { if (conn2 != null && conn2.isOpen()) {
cycleCounter.incrementAndGet(); cycleCounter.incrementAndGet();
usingCounter.incrementAndGet(); usingCounter.incrementAndGet();