use of org.infinispan.factories.threads.NonBlockingThreadPoolExecutorFactory in project infinispan by infinispan.
the class NettyEventLoopFactory method construct.
@Override
public Object construct(String componentName) {
ThreadFactory threadFactory = globalConfiguration.nonBlockingThreadPool().threadFactory();
if (threadFactory == null) {
threadFactory = new NonBlockingThreadFactory("ISPN-non-blocking-thread-group", getDefaultThreadPrio(KnownComponentNames.NON_BLOCKING_EXECUTOR), DefaultThreadFactory.DEFAULT_PATTERN, globalConfiguration.transport().nodeName(), shortened(KnownComponentNames.NON_BLOCKING_EXECUTOR));
}
ThreadPoolExecutorFactory<?> tpef = globalConfiguration.nonBlockingThreadPool().threadPoolFactory();
int threadAmount = tpef instanceof NonBlockingThreadPoolExecutorFactory ? ((NonBlockingThreadPoolExecutorFactory) tpef).maxThreads() : getDefaultThreads(KnownComponentNames.NON_BLOCKING_EXECUTOR);
// which means the non blocking executor may have an unbounded queue, depending upon netty implementation
return new NonRecursiveEventLoopGroup(buildEventLoop(threadAmount, threadFactory, "non-blocking-thread-netty"));
}
Aggregations