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.
See Also:
  • Method Details

    • newEventLoopGroup

      public static io.netty.channel.EventLoopGroup newEventLoopGroup(int numThreads)
      Returns a newly-created EventLoopGroup.
      Parameters:
      numThreads - the number of event loop threads
    • newEventLoopGroup

      public static io.netty.channel.EventLoopGroup newEventLoopGroup(int numThreads, boolean useDaemonThreads)
      Returns a newly-created EventLoopGroup.
      Parameters:
      numThreads - the number of event loop threads
      useDaemonThreads - whether to create daemon threads or not
    • newEventLoopGroup

      public static io.netty.channel.EventLoopGroup newEventLoopGroup(int numThreads, String threadNamePrefix)
      Returns a newly-created EventLoopGroup.
      Parameters:
      numThreads - the number of event loop threads
      threadNamePrefix - the prefix of thread names
    • newEventLoopGroup

      public static io.netty.channel.EventLoopGroup newEventLoopGroup(int numThreads, String threadNamePrefix, boolean useDaemonThreads)
      Returns a newly-created EventLoopGroup.
      Parameters:
      numThreads - the number of event loop threads
      threadNamePrefix - the prefix of thread names
      useDaemonThreads - whether to create daemon threads or not
    • newEventLoopGroup

      public static io.netty.channel.EventLoopGroup newEventLoopGroup(int numThreads, ThreadFactory threadFactory)
      Returns a newly-created EventLoopGroup.
      Parameters:
      numThreads - the number of event loop threads
      threadFactory - the factory of event loop threads
    • warmUp

      public static io.netty.channel.EventLoopGroup warmUp(io.netty.channel.EventLoopGroup eventLoopGroup)
      Warms up all EventLoops in the given eventLoopGroup by making sure all event loop threads are active.
    • directEventLoop

      public static io.netty.channel.EventLoop directEventLoop()
      Returns a special EventLoop which executes submitted tasks in the caller thread. Note that this EventLoop will raise an UnsupportedOperationException for any operations related with EventLoop shutdown or Channel registration.
    • serverChannelType

      @Deprecated public static Class<? extends io.netty.channel.ServerChannel> serverChannelType(io.netty.channel.EventLoopGroup eventLoopGroup)
      Returns the ServerChannel class that is available for this eventLoopGroup, for use in configuring a custom Bootstrap.
    • socketChannelType

      @Deprecated public static Class<? extends io.netty.channel.socket.SocketChannel> socketChannelType(io.netty.channel.EventLoopGroup eventLoopGroup)
      Returns the available SocketChannel class for eventLoopGroup, for use in configuring a custom Bootstrap.
    • datagramChannelType

      @Deprecated public static Class<? extends io.netty.channel.socket.DatagramChannel> datagramChannelType(io.netty.channel.EventLoopGroup eventLoopGroup)
      Returns the available DatagramChannel class for eventLoopGroup, for use in configuring a custom Bootstrap.