public static <T extends EventExecutorGroup> EventExecutorGroup createEventLoopGroup(Class<T> type, int numberOfThreads) {

        logger.debug("Creating executor {}", type.getName());

        if (DefaultEventExecutorGroup.class.equals(type)) {
            return new DefaultEventExecutorGroup(numberOfThreads, new DefaultThreadFactory("lettuce-eventExecutorLoop", true));
        }

        if (NioEventLoopGroup.class.equals(type)) {
            return new NioEventLoopGroup(numberOfThreads, new DefaultThreadFactory("lettuce-nioEventLoop", true));
        }

        if (EpollProvider.isAvailable() && EpollProvider.isEventLoopGroup(type)) {
            return EpollProvider.newEventLoopGroup(numberOfThreads, new DefaultThreadFactory("lettuce-epollEventLoop", true));
        }

        if (KqueueProvider.isAvailable() && KqueueProvider.isEventLoopGroup(type)) {
            return KqueueProvider.newEventLoopGroup(numberOfThreads, new DefaultThreadFactory("lettuce-kqueueEventLoop", true));
        }

        throw new IllegalArgumentException(String.format("Type %s not supported", type.getName()));
    }
public static < T extends EventExecutorGroup > EventExecutorGroup createEventLoopGroup ( Class < T > type , int numberOfThreads ) { logger . debug ( "Creating executor {}" , type . getName ( ) ) ; if ( DefaultEventExecutorGroup . class . equals ( type ) ) { return new DefaultEventExecutorGroup ( numberOfThreads , new DefaultThreadFactory ( "lettuce-eventExecutorLoop" , true ) ) ; } if ( NioEventLoopGroup . class . equals ( type ) ) { return new NioEventLoopGroup ( numberOfThreads , new DefaultThreadFactory ( "lettuce-nioEventLoop" , true ) ) ; } if ( EpollProvider . isAvailable ( ) && EpollProvider . isEventLoopGroup ( type ) ) { return EpollProvider . newEventLoopGroup ( numberOfThreads , new DefaultThreadFactory ( "lettuce-epollEventLoop" , true ) ) ; } if ( KqueueProvider . isAvailable ( ) && KqueueProvider . isEventLoopGroup ( type ) ) { return KqueueProvider . newEventLoopGroup ( numberOfThreads , new DefaultThreadFactory ( "lettuce-kqueueEventLoop" , true ) ) ; } throw new IllegalArgumentException ( String . format ( "Type %s not supported" , type . getName ( ) ) ) ; }
Create an instance of a {@link EventExecutorGroup}. Supported types are:
<ul>
<li>DefaultEventExecutorGroup</li>
<li>NioEventLoopGroup</li>
<li>EpollEventLoopGroup</li>
</ul>

@param type the type
@param numberOfThreads the number of threads to use for the {@link EventExecutorGroup}
@param <T> type parameter
@return a new instance of a {@link EventExecutorGroup}
@throws IllegalArgumentException if the {@code type} is not supported.