Class EventLoopUtil
java.lang.Object
org.apache.pulsar.common.util.netty.EventLoopUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
enableTriggeredMode
(io.netty.bootstrap.ServerBootstrap bootstrap) static Class<? extends io.netty.channel.socket.SocketChannel>
getClientSocketChannelClass
(io.netty.channel.EventLoopGroup eventLoopGroup) Return a SocketChannel class suitable for the given EventLoopGroup implementation.static Class<? extends io.netty.channel.socket.DatagramChannel>
getDatagramChannelClass
(io.netty.channel.EventLoopGroup eventLoopGroup) static Class<? extends io.netty.channel.socket.ServerSocketChannel>
getServerSocketChannelClass
(io.netty.channel.EventLoopGroup eventLoopGroup) static io.netty.channel.EventLoopGroup
newEventLoopGroup
(int nThreads, boolean enableBusyWait, ThreadFactory threadFactory) static CompletableFuture<Void>
shutdownGracefully
(io.netty.channel.EventLoopGroup eventLoopGroup) Shutdowns the EventLoopGroup gracefully.
-
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 aCompletableFuture
- Parameters:
eventLoopGroup
- the event loop to shutdown- Returns:
- CompletableFuture that completes when the shutdown has completed
-