Class NettyIoExecutors
- java.lang.Object
-
- io.servicetalk.transport.netty.internal.NettyIoExecutors
-
public final class NettyIoExecutors extends java.lang.Object
A static factory to create or convert toNettyIoExecutor
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.netty.channel.EventLoopGroup
createEventLoopGroup(int ioThreads, java.util.concurrent.ThreadFactory threadFactory)
Create a newEventLoopGroup
.static EventLoopAwareNettyIoExecutor
createIoExecutor(int ioThreads, java.util.concurrent.ThreadFactory threadFactory)
Create a newNettyIoExecutor
.static EventLoopAwareNettyIoExecutor
createIoExecutor(java.util.concurrent.ThreadFactory threadFactory)
Create a newNettyIoExecutor
with the default number ofioThreads
.static NettyIoExecutor
fromNettyEventLoop(io.netty.channel.EventLoop eventLoop)
Creates a new instance ofNettyIoExecutor
using the passedEventLoop
.static NettyIoExecutor
fromNettyEventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup)
Creates a new instance ofNettyIoExecutor
using the passedEventLoopGroup
.static NettyIoExecutor
toNettyIoExecutor(IoExecutor ioExecutor)
Attempts to convert the passedIoExecutor
to aNettyIoExecutor
.
-
-
-
Method Detail
-
createIoExecutor
public static EventLoopAwareNettyIoExecutor createIoExecutor(java.util.concurrent.ThreadFactory threadFactory)
Create a newNettyIoExecutor
with the default number ofioThreads
.- Parameters:
threadFactory
- theThreadFactory
to 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
- theThreadFactory
to 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
- theThreadFactory
to use.- Returns:
- The created
IoExecutor
-
toNettyIoExecutor
public static NettyIoExecutor toNettyIoExecutor(IoExecutor ioExecutor)
Attempts to convert the passedIoExecutor
to aNettyIoExecutor
.- Parameters:
ioExecutor
-IoExecutor
to convert.- Returns:
NettyIoExecutor
corresponding to the passedIoExecutor
.- Throws:
java.lang.IllegalArgumentException
- IfIoExecutor
is not of typeNettyIoExecutor
.
-
fromNettyEventLoop
public static NettyIoExecutor fromNettyEventLoop(io.netty.channel.EventLoop eventLoop)
Creates a new instance ofNettyIoExecutor
using the passedEventLoop
.- Parameters:
eventLoop
-EventLoop
to use to create a newNettyIoExecutor
.- Returns:
- New
NettyIoExecutor
using the passedEventLoop
.
-
fromNettyEventLoopGroup
public static NettyIoExecutor fromNettyEventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup)
Creates a new instance ofNettyIoExecutor
using the passedEventLoopGroup
.- Parameters:
eventLoopGroup
-EventLoopGroup
to use to create a newNettyIoExecutor
.- Returns:
- New
NettyIoExecutor
using the passedEventLoopGroup
.
-
-