Class NettyHttpServerConfiguration.EventLoopConfig
java.lang.Object
io.micronaut.http.server.netty.configuration.NettyHttpServerConfiguration.EventLoopConfig
- All Implemented Interfaces:
Named
,EventLoopGroupConfiguration
- Direct Known Subclasses:
NettyHttpServerConfiguration.Parent
,NettyHttpServerConfiguration.Worker
- Enclosing class:
- NettyHttpServerConfiguration
public abstract static class NettyHttpServerConfiguration.EventLoopConfig
extends Object
implements 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 TypeMethodDescriptiongetName()
int
int
boolean
void
setEventLoopGroup
(String name) Sets the name to use.void
setExecutor
(String executor) A named executor service to use for event loop threads (optional).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
-
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
A named executor service to use for event loop threads (optional). This property is very specialized. In particular, it will not solve read timeouts or fix blocking operations on the event loop, in fact it may do the opposite. Don't use unless you really know what this does.- 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 interfaceEventLoopGroupConfiguration
- Returns:
- The I/O ratio to use
-
getExecutorName
- Specified by:
getExecutorName
in interfaceEventLoopGroupConfiguration
- Returns:
- The name of the configured executor to use
-
getNumThreads
public int getNumThreads()- Specified by:
getNumThreads
in interfaceEventLoopGroupConfiguration
- Returns:
- The number of threads for the event loop
-
isPreferNativeTransport
public boolean isPreferNativeTransport()- Specified by:
isPreferNativeTransport
in interfaceEventLoopGroupConfiguration
- Returns:
- Whether to prefer the native transport
-
getShutdownQuietPeriod
- Specified by:
getShutdownQuietPeriod
in interfaceEventLoopGroupConfiguration
- Returns:
- The shutdown quiet period
-
getShutdownTimeout
- Specified by:
getShutdownTimeout
in interfaceEventLoopGroupConfiguration
- Returns:
- The shutdown timeout (must be >= shutdownQuietPeriod)
-