Package ratpack.exec
Interface ExecControllerBuilder
-
- All Superinterfaces:
ExecControllerSpec
public interface ExecControllerBuilder extends ExecControllerSpec
A builder of an exec controller.- Since:
- 1.10
- See Also:
ExecControllerBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExecControllerBuilderblockingThreadIdleTimeout(java.time.Duration idleTimeout)The duration to allow a non-core blocking thread to remain in the pool before terminating it.ExecControllerbuild()Creates a controller from the current state.ExecControllerBuildercontextClassLoader(java.lang.ClassLoader classLoader)The context classloader to initialize threads with.ExecControllerBuilderexecInitializers(java.lang.Iterable<? extends ExecInitializer> initializers)The exec initializers to use for initializing executions.ExecControllerBuilderexecInterceptors(java.lang.Iterable<? extends ExecInterceptor> interceptors)The exec interceptors to use for intercepting executions.ExecControllerBuildernumThreads(int n)Sets the number of compute threads to use.
-
-
-
Method Detail
-
numThreads
ExecControllerBuilder numThreads(int n)
Sets the number of compute threads to use.Defaults to
Runtime.getRuntime().availableProcessors() * 2.- Specified by:
numThreadsin interfaceExecControllerSpec- Parameters:
n- the number of compute threads to use- Returns:
this
-
contextClassLoader
ExecControllerBuilder contextClassLoader(java.lang.ClassLoader classLoader)
The context classloader to initialize threads with.Defaults to the current context classloader of the thread that created
this.- Specified by:
contextClassLoaderin interfaceExecControllerSpec- Parameters:
classLoader- the context classloader to initialize threads with- Returns:
this
-
blockingThreadIdleTimeout
ExecControllerBuilder blockingThreadIdleTimeout(java.time.Duration idleTimeout)
The duration to allow a non-core blocking thread to remain in the pool before terminating it.Defaults to 60 seconds.
- Specified by:
blockingThreadIdleTimeoutin interfaceExecControllerSpec- Parameters:
idleTimeout- the duration to allow a non-core blocking thread to remain in the pool before terminating it- Returns:
this
-
execInitializers
ExecControllerBuilder execInitializers(java.lang.Iterable<? extends ExecInitializer> initializers)
The exec initializers to use for initializing executions.- Specified by:
execInitializersin interfaceExecControllerSpec- Parameters:
initializers- the exec initializers to use for initializing executions- Returns:
this
-
execInterceptors
ExecControllerBuilder execInterceptors(java.lang.Iterable<? extends ExecInterceptor> interceptors)
The exec interceptors to use for intercepting executions.- Specified by:
execInterceptorsin interfaceExecControllerSpec- Parameters:
interceptors- exec interceptors to use for intercepting executions- Returns:
this
-
build
ExecController build()
Creates a controller from the current state.- Returns:
- a controller from the current state
-
-