Class NettyHttpServerConfiguration.EventLoopConfig
java.lang.Object
io.micronaut.http.server.netty.configuration.NettyHttpServerConfiguration.EventLoopConfig
- All Implemented Interfaces:
io.micronaut.core.naming.Named,io.micronaut.http.netty.channel.EventLoopGroupConfiguration
- Direct Known Subclasses:
NettyHttpServerConfiguration.Parent,NettyHttpServerConfiguration.Worker
- Enclosing class:
- NettyHttpServerConfiguration
public abstract static class NettyHttpServerConfiguration.EventLoopConfig
extends Object
implements io.micronaut.http.netty.channel.EventLoopGroupConfiguration
Abstract class for configuring the Netty event loop.
-
Field Summary
Fields inherited from interface io.micronaut.http.netty.channel.EventLoopGroupConfiguration
DEFAULT, DEFAULT_LOOP, DEFAULT_SHUTDOWN_QUIET_PERIOD, DEFAULT_SHUTDOWN_TIMEOUT, EVENT_LOOPS -
Method Summary
Modifier and TypeMethodDescription@NonNull StringgetName()intintbooleanvoidsetEventLoopGroup(String name) Sets the name to use.voidsetExecutor(String executor) Sets the name of the executor.voidsetIoRatio(Integer ioRatio) Sets the I/O ratio.voidsetPreferNativeTransport(boolean preferNativeTransport) voidsetShutdownQuietPeriod(Duration shutdownQuietPeriod) voidsetShutdownTimeout(Duration shutdownTimeout) voidsetThreads(int threads) Sets the number of threads for the event loop group.
-
Method Details
-
getName
- Specified by:
getNamein interfaceio.micronaut.core.naming.Named
-
setEventLoopGroup
Sets the name to use.- Parameters:
name- The name
-
setThreads
public void setThreads(int threads) Sets the number of threads for the event loop group.- Parameters:
threads- The number of threads
-
setIoRatio
Sets the I/O ratio.- Parameters:
ioRatio- The I/O ratio
-
setExecutor
Sets the name of the executor.- Parameters:
executor- The executor
-
setPreferNativeTransport
public void setPreferNativeTransport(boolean preferNativeTransport) - Parameters:
preferNativeTransport- Set whether to prefer the native transport if available
-
setShutdownQuietPeriod
- Parameters:
shutdownQuietPeriod- Set the shutdown quiet period
-
setShutdownTimeout
- Parameters:
shutdownTimeout- Set the shutdown timeout (must be >= shutdownQuietPeriod)
-
getNumOfThreads
public int getNumOfThreads()- Returns:
- The number of threads to use
-
getIoRatio
- Specified by:
getIoRatioin interfaceio.micronaut.http.netty.channel.EventLoopGroupConfiguration- Returns:
- The I/O ratio to use
-
getExecutorName
- Specified by:
getExecutorNamein interfaceio.micronaut.http.netty.channel.EventLoopGroupConfiguration- Returns:
- The name of the configured executor to use
-
getNumThreads
public int getNumThreads()- Specified by:
getNumThreadsin interfaceio.micronaut.http.netty.channel.EventLoopGroupConfiguration
-
isPreferNativeTransport
public boolean isPreferNativeTransport()- Specified by:
isPreferNativeTransportin interfaceio.micronaut.http.netty.channel.EventLoopGroupConfiguration
-
getShutdownQuietPeriod
- Specified by:
getShutdownQuietPeriodin interfaceio.micronaut.http.netty.channel.EventLoopGroupConfiguration
-
getShutdownTimeout
- Specified by:
getShutdownTimeoutin interfaceio.micronaut.http.netty.channel.EventLoopGroupConfiguration
-