Package com.linecorp.armeria.common.util
Class EventLoopGroups
java.lang.Object
com.linecorp.armeria.common.util.EventLoopGroups
public final class EventLoopGroups extends Object
Provides methods that are useful for creating an
EventLoopGroup
.-
Method Summary
Modifier and Type Method Description static Class<? extends DatagramChannel>
datagramChannelType(EventLoopGroup eventLoopGroup)
Returns the availableDatagramChannel
class foreventLoopGroup
, for use in configuring a customBootstrap
.static EventLoop
directEventLoop()
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)
Returns theServerChannel
class that is available for thiseventLoopGroup
, for use in configuring a customBootstrap
.static Class<? extends SocketChannel>
socketChannelType(EventLoopGroup eventLoopGroup)
Returns the availableSocketChannel
class foreventLoopGroup
, for use in configuring a customBootstrap
.
-
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
-
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
Returns theServerChannel
class that is available for thiseventLoopGroup
, for use in configuring a customBootstrap
. -
socketChannelType
Returns the availableSocketChannel
class foreventLoopGroup
, for use in configuring a customBootstrap
. -
datagramChannelType
Returns the availableDatagramChannel
class foreventLoopGroup
, for use in configuring a customBootstrap
.
-