Class EventLoopUtil


  • public class EventLoopUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      EventLoopUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void enableTriggeredMode​(io.netty.bootstrap.ServerBootstrap bootstrap)  
      static java.lang.Class<? extends io.netty.channel.socket.SocketChannel> getClientSocketChannelClass​(io.netty.channel.EventLoopGroup eventLoopGroup)
      Return a SocketChannel class suitable for the given EventLoopGroup implementation.
      static java.lang.Class<? extends io.netty.channel.socket.DatagramChannel> getDatagramChannelClass​(io.netty.channel.EventLoopGroup eventLoopGroup)  
      static java.lang.Class<? extends io.netty.channel.socket.ServerSocketChannel> getServerSocketChannelClass​(io.netty.channel.EventLoopGroup eventLoopGroup)  
      static io.netty.channel.EventLoopGroup newEventLoopGroup​(int nThreads, boolean enableBusyWait, java.util.concurrent.ThreadFactory threadFactory)  
      static java.util.concurrent.CompletableFuture<java.lang.Void> shutdownGracefully​(io.netty.channel.EventLoopGroup eventLoopGroup)
      Shutdowns the EventLoopGroup gracefully.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EventLoopUtil

        public EventLoopUtil()
    • Method Detail

      • newEventLoopGroup

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

        public static java.lang.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 java.lang.Class<? extends io.netty.channel.socket.ServerSocketChannel> getServerSocketChannelClass​(io.netty.channel.EventLoopGroup eventLoopGroup)
      • getDatagramChannelClass

        public static java.lang.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 java.util.concurrent.CompletableFuture<java.lang.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