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.ComputeSpeceventLoopGroup(BiFunction<Integer,ThreadFactory,io.netty.channel.EventLoopGroup> eventLoopGroupFactory)Specify a factory that generates NettyEventLoopGroupinstances with the arguments.ExecControllerSpec.ComputeSpecprefix(String prefix)Specify the thread prefix to utilize when constructing new threads from this group.ExecControllerSpec.ComputeSpecpriority(int priority)Specify the thread priority for threads created by this group.ExecControllerSpec.ComputeSpecthreads(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:
threadsin 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:
prefixin 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:
priorityin 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 NettyEventLoopGroupinstances 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:EpollKQueueNIO- Specified by:
eventLoopGroupin interfaceExecControllerSpec.EventLoopSpec- Parameters:
eventLoopGroupFactory- a factory that creates event loop group instances- Returns:
this
-
-