Package io.micronaut.http.netty.channel
Class DefaultEventLoopGroupConfiguration
java.lang.Object
io.micronaut.http.netty.channel.DefaultEventLoopGroupConfiguration
- All Implemented Interfaces:
- Named,- EventLoopGroupConfiguration
@EachProperty(value="micronaut.netty.event-loops",
              primary="default")
public class DefaultEventLoopGroupConfiguration
extends Object
implements EventLoopGroupConfiguration
Configuration interface for event loop configuration.
- Since:
- 2.0
- Author:
- graemerocher
- 
Field SummaryFields inherited from interface io.micronaut.http.netty.channel.EventLoopGroupConfigurationDEFAULT, DEFAULT_LOOP, DEFAULT_SHUTDOWN_QUIET_PERIOD, DEFAULT_SHUTDOWN_TIMEOUT, DEFAULT_THREAD_CORE_RATIO, EVENT_LOOPS
- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructor.DefaultEventLoopGroupConfiguration(String name, int numThreads, double threadCoreRatio, @Nullable Integer ioRatio, boolean preferNativeTransport, @Nullable List<String> transport, @Nullable String executor, @Nullable Duration shutdownQuietPeriod, @Nullable Duration shutdownTimeout, boolean loomCarrier) Default constructor.DefaultEventLoopGroupConfiguration(String name, int numThreads, double threadCoreRatio, Integer ioRatio, boolean preferNativeTransport, String executor, Duration shutdownQuietPeriod, Duration shutdownTimeout, boolean loomCarrier) Deprecated.DefaultEventLoopGroupConfiguration(String name, int numThreads, Integer ioRatio, boolean preferNativeTransport, String executor, Duration shutdownQuietPeriod, Duration shutdownTimeout) Deprecated.
- 
Method SummaryModifier and TypeMethodDescriptiongetName()intdoubleThe number of threads per core to use ifEventLoopGroupConfiguration.getNumThreads()is set to 0.The transports to use for this event loop, in order of preference.booleanboolean
- 
Constructor Details- 
DefaultEventLoopGroupConfiguration@ConfigurationInject public DefaultEventLoopGroupConfiguration(@Parameter String name, @Bindable(defaultValue="0") int numThreads, @Bindable(defaultValue="1.0") double threadCoreRatio, @Nullable @Nullable Integer ioRatio, @Bindable(defaultValue="false") boolean preferNativeTransport, @Nullable @Nullable List<String> transport, @Nullable @Nullable String executor, @Nullable @Nullable Duration shutdownQuietPeriod, @Nullable @Nullable Duration shutdownTimeout, @Bindable(defaultValue="false") boolean loomCarrier) Default constructor.- Parameters:
- name- The name of the group
- numThreads- The number of threads
- threadCoreRatio- The number of threads per core to use if- getNumThreads()is set to 0.
- ioRatio- The IO ratio (optional)
- preferNativeTransport- Whether native transport is to be preferred
- transport- The transports to use for this event loop, in order of preference. Supported values are- io_uring,epoll,kqueue,nio. The first available transport out of those listed will be used (nio is always available). If no listed transport is available, an exception will be thrown.- By default, only - niois used, even if native transports are available. If the legacy- prefer-native-transportproperty is set to- true, this defaults to- io_uring,epoll,kqueue,nio.
- executor- 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.
- shutdownQuietPeriod- The shutdown quiet period
- shutdownTimeout- The shutdown timeout (must be >= shutdownQuietPeriod)
- loomCarrier- When set to- true, use a special experimental event loop that can also execute virtual threads, in order to improve virtual thread performance.
 
- 
DefaultEventLoopGroupConfiguration@Deprecated public DefaultEventLoopGroupConfiguration(String name, int numThreads, double threadCoreRatio, Integer ioRatio, boolean preferNativeTransport, String executor, Duration shutdownQuietPeriod, Duration shutdownTimeout, boolean loomCarrier) Deprecated.
- 
DefaultEventLoopGroupConfiguration@Deprecated public DefaultEventLoopGroupConfiguration(String name, int numThreads, Integer ioRatio, boolean preferNativeTransport, String executor, Duration shutdownQuietPeriod, Duration shutdownTimeout) Deprecated.
- 
DefaultEventLoopGroupConfigurationpublic DefaultEventLoopGroupConfiguration()Default constructor.
 
- 
- 
Method Details- 
getNumThreadspublic int getNumThreads()- Specified by:
- getNumThreadsin interface- EventLoopGroupConfiguration
- Returns:
- The number of threads for the event loop
 
- 
getThreadCoreRatiopublic double getThreadCoreRatio()Description copied from interface:EventLoopGroupConfigurationThe number of threads per core to use ifEventLoopGroupConfiguration.getNumThreads()is set to 0.- Specified by:
- getThreadCoreRatioin interface- EventLoopGroupConfiguration
- Returns:
- The thread-to-core ratio
 
- 
getIoRatio- Specified by:
- getIoRatioin interface- EventLoopGroupConfiguration
- Returns:
- The I/O ratio.
 
- 
getExecutorName- Specified by:
- getExecutorNamein interface- EventLoopGroupConfiguration
- Returns:
- The name of the executor to use.
 
- 
isPreferNativeTransportpublic boolean isPreferNativeTransport()- Specified by:
- isPreferNativeTransportin interface- EventLoopGroupConfiguration
- Returns:
- Whether to prefer the native transport
 
- 
getTransportDescription copied from interface:EventLoopGroupConfigurationThe transports to use for this event loop, in order of preference. Supported values areio_uring,epoll,kqueue,nio. The first available transport out of those listed will be used (nio is always available). If no listed transport is available, an exception will be thrown.By default, only niois used, even if native transports are available. If the legacyprefer-native-transportproperty is set totrue, this defaults toio_uring,epoll,kqueue,nio.- Specified by:
- getTransportin interface- EventLoopGroupConfiguration
- Returns:
- The available transports, in order of preference
 
- 
getName
- 
getShutdownQuietPeriod- Specified by:
- getShutdownQuietPeriodin interface- EventLoopGroupConfiguration
- Returns:
- The shutdown quiet period
 
- 
getShutdownTimeout- Specified by:
- getShutdownTimeoutin interface- EventLoopGroupConfiguration
- Returns:
- The shutdown timeout (must be >= shutdownQuietPeriod)
 
- 
isLoomCarrierpublic boolean isLoomCarrier()- Specified by:
- isLoomCarrierin interface- EventLoopGroupConfiguration
- Returns:
- When set to true, use a special experimental event loop that can also execute virtual threads, in order to improve virtual thread performance.
 
 
-