Package com.linecorp.armeria.common.util
Class EventLoopGroups
java.lang.Object
com.linecorp.armeria.common.util.EventLoopGroups
Provides methods that are useful for creating an
EventLoopGroup
.-
Method Summary
Modifier and TypeMethodDescriptionstatic Class<? extends io.netty.channel.socket.DatagramChannel>
datagramChannelType
(io.netty.channel.EventLoopGroup eventLoopGroup) Deprecated.static io.netty.channel.EventLoop
Returns a specialEventLoop
which executes submitted tasks in the caller thread.static io.netty.channel.EventLoopGroup
newEventLoopGroup
(int numThreads) Returns a newly-createdEventLoopGroup
.static io.netty.channel.EventLoopGroup
newEventLoopGroup
(int numThreads, boolean useDaemonThreads) Returns a newly-createdEventLoopGroup
.static io.netty.channel.EventLoopGroup
newEventLoopGroup
(int numThreads, String threadNamePrefix) Returns a newly-createdEventLoopGroup
.static io.netty.channel.EventLoopGroup
newEventLoopGroup
(int numThreads, String threadNamePrefix, boolean useDaemonThreads) Returns a newly-createdEventLoopGroup
.static io.netty.channel.EventLoopGroup
newEventLoopGroup
(int numThreads, ThreadFactory threadFactory) Returns a newly-createdEventLoopGroup
.static Class<? extends io.netty.channel.ServerChannel>
serverChannelType
(io.netty.channel.EventLoopGroup eventLoopGroup) Deprecated.static Class<? extends io.netty.channel.socket.SocketChannel>
socketChannelType
(io.netty.channel.EventLoopGroup eventLoopGroup) Deprecated.static io.netty.channel.EventLoopGroup
warmUp
(io.netty.channel.EventLoopGroup eventLoopGroup) Warms up allEventLoop
s in the giveneventLoopGroup
by making sure all event loop threads are active.
-
Method Details
-
newEventLoopGroup
public static io.netty.channel.EventLoopGroup newEventLoopGroup(int numThreads) Returns a newly-createdEventLoopGroup
.- Parameters:
numThreads
- the number of event loop threads
-
newEventLoopGroup
public static io.netty.channel.EventLoopGroup newEventLoopGroup(int numThreads, boolean useDaemonThreads) Returns a newly-createdEventLoopGroup
.- Parameters:
numThreads
- the number of event loop threadsuseDaemonThreads
- whether to create daemon threads or not
-
newEventLoopGroup
public static io.netty.channel.EventLoopGroup newEventLoopGroup(int numThreads, String threadNamePrefix) Returns a newly-createdEventLoopGroup
.- Parameters:
numThreads
- the number of event loop threadsthreadNamePrefix
- the prefix of thread names
-
newEventLoopGroup
public static io.netty.channel.EventLoopGroup newEventLoopGroup(int numThreads, String threadNamePrefix, boolean useDaemonThreads) Returns a newly-createdEventLoopGroup
.- Parameters:
numThreads
- the number of event loop threadsthreadNamePrefix
- the prefix of thread namesuseDaemonThreads
- whether to create daemon threads or not
-
newEventLoopGroup
public static io.netty.channel.EventLoopGroup newEventLoopGroup(int numThreads, ThreadFactory threadFactory) Returns a newly-createdEventLoopGroup
.- Parameters:
numThreads
- the number of event loop threadsthreadFactory
- the factory of event loop threads
-
warmUp
public static io.netty.channel.EventLoopGroup warmUp(io.netty.channel.EventLoopGroup eventLoopGroup) Warms up allEventLoop
s in the giveneventLoopGroup
by making sure all event loop threads are active. -
directEventLoop
public static io.netty.channel.EventLoop directEventLoop()Returns a specialEventLoop
which executes submitted tasks in the caller thread. Note that thisEventLoop
will raise anUnsupportedOperationException
for any operations related withEventLoop
shutdown orChannel
registration. -
serverChannelType
@Deprecated public static Class<? extends io.netty.channel.ServerChannel> serverChannelType(io.netty.channel.EventLoopGroup eventLoopGroup) Deprecated.Returns theServerChannel
class that is available for thiseventLoopGroup
, for use in configuring a customBootstrap
. -
socketChannelType
@Deprecated public static Class<? extends io.netty.channel.socket.SocketChannel> socketChannelType(io.netty.channel.EventLoopGroup eventLoopGroup) Deprecated.Returns the availableSocketChannel
class foreventLoopGroup
, for use in configuring a customBootstrap
. -
datagramChannelType
@Deprecated public static Class<? extends io.netty.channel.socket.DatagramChannel> datagramChannelType(io.netty.channel.EventLoopGroup eventLoopGroup) Deprecated.Returns the availableDatagramChannel
class foreventLoopGroup
, for use in configuring a customBootstrap
.
-
TransportType.datagramChannelType(EventLoopGroup)
.