Class EventLoopUtil

java.lang.Object
org.apache.pulsar.common.util.netty.EventLoopUtil

public class EventLoopUtil extends Object
  • Constructor Details

    • EventLoopUtil

      public EventLoopUtil()
  • Method Details

    • newEventLoopGroup

      public static io.netty.channel.EventLoopGroup newEventLoopGroup(int nThreads, boolean enableBusyWait, ThreadFactory threadFactory)
      Returns:
      an EventLoopGroup suitable for the current platform
    • getClientSocketChannelClass

      public static Class<? extends io.netty.channel.socket.SocketChannel> getClientSocketChannelClass(io.netty.channel.EventLoopGroup eventLoopGroup)
      Return a SocketChannel class suitable for the given EventLoopGroup implementation.
      Parameters:
      eventLoopGroup -
      Returns:
    • getServerSocketChannelClass

      public static Class<? extends io.netty.channel.socket.ServerSocketChannel> getServerSocketChannelClass(io.netty.channel.EventLoopGroup eventLoopGroup)
    • getDatagramChannelClass

      public static Class<? extends io.netty.channel.socket.DatagramChannel> getDatagramChannelClass(io.netty.channel.EventLoopGroup eventLoopGroup)
    • enableTriggeredMode

      public static void enableTriggeredMode(io.netty.bootstrap.ServerBootstrap bootstrap)
    • shutdownGracefully

      public static CompletableFuture<Void> shutdownGracefully(io.netty.channel.EventLoopGroup eventLoopGroup)
      Shutdowns the EventLoopGroup gracefully. Returns a CompletableFuture
      Parameters:
      eventLoopGroup - the event loop to shutdown
      Returns:
      CompletableFuture that completes when the shutdown has completed