Class NettyIoExecutors
- java.lang.Object
-
- io.servicetalk.transport.netty.internal.NettyIoExecutors
-
public final class NettyIoExecutors extends java.lang.ObjectA static factory to create or convert toNettyIoExecutor.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.netty.channel.EventLoopGroupcreateEventLoopGroup(int ioThreads, java.util.concurrent.ThreadFactory threadFactory)Create a newEventLoopGroup.static EventLoopAwareNettyIoExecutorcreateIoExecutor(int ioThreads, java.util.concurrent.ThreadFactory threadFactory)Create a newNettyIoExecutor.static EventLoopAwareNettyIoExecutorcreateIoExecutor(java.util.concurrent.ThreadFactory threadFactory)Create a newNettyIoExecutorwith the default number ofioThreads.static NettyIoExecutorfromNettyEventLoop(io.netty.channel.EventLoop eventLoop)Creates a new instance ofNettyIoExecutorusing the passedEventLoop.static NettyIoExecutorfromNettyEventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup)Creates a new instance ofNettyIoExecutorusing the passedEventLoopGroup.static NettyIoExecutortoNettyIoExecutor(IoExecutor ioExecutor)Attempts to convert the passedIoExecutorto aNettyIoExecutor.
-
-
-
Method Detail
-
createIoExecutor
public static EventLoopAwareNettyIoExecutor createIoExecutor(java.util.concurrent.ThreadFactory threadFactory)
Create a newNettyIoExecutorwith the default number ofioThreads.- Parameters:
threadFactory- theThreadFactoryto use.- Returns:
- The created
IoExecutor
-
createIoExecutor
public static EventLoopAwareNettyIoExecutor createIoExecutor(int ioThreads, java.util.concurrent.ThreadFactory threadFactory)
Create a newNettyIoExecutor.- Parameters:
ioThreads- number of threads.threadFactory- theThreadFactoryto use.- Returns:
- The created
IoExecutor
-
createEventLoopGroup
public static io.netty.channel.EventLoopGroup createEventLoopGroup(int ioThreads, java.util.concurrent.ThreadFactory threadFactory)Create a newEventLoopGroup.- Parameters:
ioThreads- number of threadsthreadFactory- theThreadFactoryto use.- Returns:
- The created
IoExecutor
-
toNettyIoExecutor
public static NettyIoExecutor toNettyIoExecutor(IoExecutor ioExecutor)
Attempts to convert the passedIoExecutorto aNettyIoExecutor.- Parameters:
ioExecutor-IoExecutorto convert.- Returns:
NettyIoExecutorcorresponding to the passedIoExecutor.- Throws:
java.lang.IllegalArgumentException- IfIoExecutoris not of typeNettyIoExecutor.
-
fromNettyEventLoop
public static NettyIoExecutor fromNettyEventLoop(io.netty.channel.EventLoop eventLoop)
Creates a new instance ofNettyIoExecutorusing the passedEventLoop.- Parameters:
eventLoop-EventLoopto use to create a newNettyIoExecutor.- Returns:
- New
NettyIoExecutorusing the passedEventLoop.
-
fromNettyEventLoopGroup
public static NettyIoExecutor fromNettyEventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup)
Creates a new instance ofNettyIoExecutorusing the passedEventLoopGroup.- Parameters:
eventLoopGroup-EventLoopGroupto use to create a newNettyIoExecutor.- Returns:
- New
NettyIoExecutorusing the passedEventLoopGroup.
-
-