- java.lang.Object
-
- io.netty5.util.NettyRuntime
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
availableProcessors()
Get the configured number of available processors.static void
setAvailableProcessors(int availableProcessors)
Set the number of available processors.
-
-
-
Method Detail
-
setAvailableProcessors
public static void setAvailableProcessors(int availableProcessors)
Set the number of available processors.- Parameters:
availableProcessors
- the number of available processors- Throws:
IllegalArgumentException
- if the specified number of available processors is non-positiveIllegalStateException
- if the number of available processors is already configured
-
availableProcessors
public static int availableProcessors()
Get the configured number of available processors. The default isRuntime.availableProcessors()
. This can be overridden by setting the system property "io.netty5.availableProcessors" or by invokingsetAvailableProcessors(int)
before any calls to this method.- Returns:
- the configured number of available processors
-
-