Package ratpack.exec
Interface ExecControllerSpec.ComputeSpec
-
- All Superinterfaces:
ExecControllerSpec.EventLoopSpec
- Enclosing interface:
- ExecControllerSpec
public static interface ExecControllerSpec.ComputeSpec extends ExecControllerSpec.EventLoopSpec
A specification for defining the default computation executor.All parameters for this specification have defaults that can be overwritten.
- See Also:
ExecControllerSpec.EventLoopSpec
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExecControllerSpec.ComputeSpec
eventLoopGroup(BiFunction<Integer,ThreadFactory,io.netty.channel.EventLoopGroup> eventLoopGroupFactory)
Specify a factory that generates NettyEventLoopGroup
instances with the arguments.ExecControllerSpec.ComputeSpec
prefix(String prefix)
Specify the thread prefix to utilize when constructing new threads from this group.ExecControllerSpec.ComputeSpec
priority(int priority)
Specify the thread priority for threads created by this group.ExecControllerSpec.ComputeSpec
threads(int threads)
Specify the number of threads for this group.
-
-
-
Method Detail
-
threads
ExecControllerSpec.ComputeSpec threads(int threads)
Specify the number of threads for this group.The default value for this parameter is 2 *
Runtime.availableProcessors()
- Specified by:
threads
in interfaceExecControllerSpec.EventLoopSpec
- Parameters:
threads
- the number of threads- Returns:
this
-
prefix
ExecControllerSpec.ComputeSpec prefix(String prefix)
Specify the thread prefix to utilize when constructing new threads from this group.The default value for this parameter is
"ratpack-compute"
- Specified by:
prefix
in interfaceExecControllerSpec.EventLoopSpec
- Parameters:
prefix
- the thread name prefix- Returns:
this
-
priority
ExecControllerSpec.ComputeSpec priority(int priority)
Specify the thread priority for threads created by this group.The default value for this parameter is
Thread.MAX_PRIORITY
- Specified by:
priority
in interfaceExecControllerSpec.EventLoopSpec
- Parameters:
priority
- the thread priority- Returns:
this
- See Also:
Thread.MAX_PRIORITY
,Thread.MIN_PRIORITY
,Thread.NORM_PRIORITY
-
eventLoopGroup
ExecControllerSpec.ComputeSpec eventLoopGroup(BiFunction<Integer,ThreadFactory,io.netty.channel.EventLoopGroup> eventLoopGroupFactory)
Specify a factory that generates NettyEventLoopGroup
instances with the arguments.The default value for this factory is
TransportDetector.eventLoopGroup(int, ThreadFactory)
which will automatically configure the most optimization implementation available on the current system in the following order:Epoll
KQueue
NIO
- Specified by:
eventLoopGroup
in interfaceExecControllerSpec.EventLoopSpec
- Parameters:
eventLoopGroupFactory
- a factory that creates event loop group instances- Returns:
this
-
-