Package io.micronaut.http.netty.channel
Interface EventLoopGroupConfiguration
- All Superinterfaces:
Named
- All Known Implementing Classes:
DefaultEventLoopGroupConfiguration
,NettyHttpServerConfiguration.EventLoopConfig
,NettyHttpServerConfiguration.Parent
,NettyHttpServerConfiguration.Worker
Default event loop group configuration interface.
- Since:
- 2.0
- Author:
- graemerocher
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The name of the default event loop group configuration.static final String
The default.static final long
The default shutdown quiet period in seconds.static final long
The default shutdown quiet period.static final double
DefaultgetThreadCoreRatio()
.static final String
The configuration property prefix. -
Method Summary
Modifier and TypeMethodDescriptionint
default Duration
default Duration
default double
The number of threads per core to use ifgetNumThreads()
is set to 0.The transports to use for this event loop, in order of preference.default boolean
boolean
Deprecated, for removal: This API element is subject to removal in a future version.
-
Field Details
-
EVENT_LOOPS
The configuration property prefix.- See Also:
-
DEFAULT
The name of the default event loop group configuration.- See Also:
-
DEFAULT_LOOP
The default.- See Also:
-
DEFAULT_THREAD_CORE_RATIO
static final double DEFAULT_THREAD_CORE_RATIODefaultgetThreadCoreRatio()
.- See Also:
-
DEFAULT_SHUTDOWN_QUIET_PERIOD
static final long DEFAULT_SHUTDOWN_QUIET_PERIODThe default shutdown quiet period in seconds. Implementation note: defaults are from io.netty.util.concurrent.AbstractEventExecutor- See Also:
-
DEFAULT_SHUTDOWN_TIMEOUT
static final long DEFAULT_SHUTDOWN_TIMEOUTThe default shutdown quiet period. Implementation note: defaults are from io.netty.util.concurrent.AbstractEventExecutor- See Also:
-
-
Method Details
-
getNumThreads
int getNumThreads()- Returns:
- The number of threads for the event loop, or 0 to use
getThreadCoreRatio()
-
getThreadCoreRatio
default double getThreadCoreRatio()The number of threads per core to use ifgetNumThreads()
is set to 0.- Returns:
- The thread-to-core ratio
- Since:
- 4.8.0
-
getIoRatio
- Returns:
- The I/O ratio.
-
getExecutorName
- Returns:
- The name of the executor to use.
-
isPreferNativeTransport
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- Whether to prefer the native transport
-
getTransport
@NonNull @NextMajorVersion("Change default to all transports") default @NonNull List<String> getTransport()The 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
nio
is used, even if native transports are available. If the legacyprefer-native-transport
property is set totrue
, this defaults toio_uring,epoll,kqueue,nio
.- Returns:
- The available transports, in order of preference
-
getShutdownQuietPeriod
- Returns:
- The shutdown quiet period
-
getShutdownTimeout
- Returns:
- The shutdown timeout (must be >= shutdownQuietPeriod)
-
isLoomCarrier
default boolean isLoomCarrier()- Returns:
- When set to
true
, use a special experimental event loop that can also execute virtual threads, in order to improve virtual thread performance.
-