builder.transport().remoteCommandThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.REMOTE_COMMAND).get()); builder.asyncThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.ASYNC_OPERATIONS).get()); builder.expirationThreadPool().read(this.schedulers.get(ScheduledThreadPoolResourceDefinition.EXPIRATION).get()); builder.listenerThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.LISTENER).get());
builder.transport().remoteCommandThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.REMOTE_COMMAND).get()); builder.asyncThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.ASYNC_OPERATIONS).get()); builder.expirationThreadPool().read(this.schedulers.get(ScheduledThreadPoolResourceDefinition.EXPIRATION).get()); builder.listenerThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.LISTENER).get());
builder.asyncThreadPool().read(this.asyncOperationsThreadPool.getValue()); builder.expirationThreadPool().read(this.expirationThreadPool.getValue()); builder.listenerThreadPool().read(this.listenerThreadPool.getValue());
public static void minimizeThreads(GlobalConfigurationBuilder builder) { BlockingThreadPoolExecutorFactory executorFactoryNoQueue = new BlockingThreadPoolExecutorFactory(NAMED_EXECUTORS_THREADS_NO_QUEUE, 0, 0, NAMED_EXECUTORS_KEEP_ALIVE); BlockingThreadPoolExecutorFactory executorFactoryWithQueue = new BlockingThreadPoolExecutorFactory(NAMED_EXECUTORS_THREADS_WITH_QUEUE, NAMED_EXECUTORS_THREADS_WITH_QUEUE, NAMED_EXECUTORS_QUEUE_SIZE, NAMED_EXECUTORS_KEEP_ALIVE); builder.transport().remoteCommandThreadPool().threadPoolFactory(executorFactoryNoQueue); builder.stateTransferThreadPool().threadPoolFactory(executorFactoryNoQueue); builder.asyncThreadPool().threadPoolFactory(executorFactoryWithQueue); builder.listenerThreadPool().threadPoolFactory(executorFactoryWithQueue); builder.transport().transportThreadPool().threadPoolFactory(executorFactoryWithQueue); // TODO Scheduled thread pools don't have a threads limit // Timeout thread pool is not configurable at all }