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 DatagramChannel>
datagramChannelType
(EventLoopGroup eventLoopGroup) Deprecated.static EventLoop
Returns a specialEventLoop
which executes submitted tasks in the caller thread.static EventLoopGroup
newEventLoopGroup
(int numThreads) Returns a newly-createdEventLoopGroup
.static EventLoopGroup
newEventLoopGroup
(int numThreads, boolean useDaemonThreads) Returns a newly-createdEventLoopGroup
.static EventLoopGroup
newEventLoopGroup
(int numThreads, String threadNamePrefix) Returns a newly-createdEventLoopGroup
.static EventLoopGroup
newEventLoopGroup
(int numThreads, String threadNamePrefix, boolean useDaemonThreads) Returns a newly-createdEventLoopGroup
.static EventLoopGroup
newEventLoopGroup
(int numThreads, ThreadFactory threadFactory) Returns a newly-createdEventLoopGroup
.static Class<? extends ServerChannel>
serverChannelType
(EventLoopGroup eventLoopGroup) Deprecated.static Class<? extends SocketChannel>
socketChannelType
(EventLoopGroup eventLoopGroup) Deprecated.static EventLoopGroup
warmUp
(EventLoopGroup eventLoopGroup) Warms up allEventLoop
s in the giveneventLoopGroup
by making sure all event loop threads are active.
-
Method Details
-
newEventLoopGroup
Returns a newly-createdEventLoopGroup
.- Parameters:
numThreads
- the number of event loop threads
-
newEventLoopGroup
Returns a newly-createdEventLoopGroup
.- Parameters:
numThreads
- the number of event loop threadsuseDaemonThreads
- whether to create daemon threads or not
-
newEventLoopGroup
Returns a newly-createdEventLoopGroup
.- Parameters:
numThreads
- the number of event loop threadsthreadNamePrefix
- the prefix of thread names
-
newEventLoopGroup
public static 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
Returns a newly-createdEventLoopGroup
.- Parameters:
numThreads
- the number of event loop threadsthreadFactory
- the factory of event loop threads
-
warmUp
Warms up allEventLoop
s in the giveneventLoopGroup
by making sure all event loop threads are active. -
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 ServerChannel> serverChannelType(EventLoopGroup eventLoopGroup) Deprecated.Returns theServerChannel
class that is available for thiseventLoopGroup
, for use in configuring a customBootstrap
. -
socketChannelType
@Deprecated public static Class<? extends SocketChannel> socketChannelType(EventLoopGroup eventLoopGroup) Deprecated.Returns the availableSocketChannel
class foreventLoopGroup
, for use in configuring a customBootstrap
. -
datagramChannelType
@Deprecated public static Class<? extends DatagramChannel> datagramChannelType(EventLoopGroup eventLoopGroup) Deprecated.Returns the availableDatagramChannel
class foreventLoopGroup
, for use in configuring a customBootstrap
.
-
TransportType.datagramChannelType(EventLoopGroup)
.