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 String
getName()
int
int
boolean
void
setEventLoopGroup
(String name) Sets the name to use.void
setExecutor
(String executor) Sets the name of the executor.void
setIoRatio
(Integer ioRatio) Sets the I/O ratio.void
setPreferNativeTransport
(boolean preferNativeTransport) void
setShutdownQuietPeriod
(Duration shutdownQuietPeriod) void
setShutdownTimeout
(Duration shutdownTimeout) void
setThreads
(int threads) Sets the number of threads for the event loop group.
-
Method Details
-
getName
- Specified by:
getName
in 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:
getIoRatio
in interfaceio.micronaut.http.netty.channel.EventLoopGroupConfiguration
- Returns:
- The I/O ratio to use
-
getExecutorName
- Specified by:
getExecutorName
in interfaceio.micronaut.http.netty.channel.EventLoopGroupConfiguration
- Returns:
- The name of the configured executor to use
-
getNumThreads
public int getNumThreads()- Specified by:
getNumThreads
in interfaceio.micronaut.http.netty.channel.EventLoopGroupConfiguration
-
isPreferNativeTransport
public boolean isPreferNativeTransport()- Specified by:
isPreferNativeTransport
in interfaceio.micronaut.http.netty.channel.EventLoopGroupConfiguration
-
getShutdownQuietPeriod
- Specified by:
getShutdownQuietPeriod
in interfaceio.micronaut.http.netty.channel.EventLoopGroupConfiguration
-
getShutdownTimeout
- Specified by:
getShutdownTimeout
in interfaceio.micronaut.http.netty.channel.EventLoopGroupConfiguration
-