Package ratpack.exec

Interface ExecControllerSpec

    • Method Detail

      • numThreads

        ExecControllerSpec numThreads​(int n)
        Sets the number of compute threads to use.

        Defaults to Runtime.getRuntime().availableProcessors() * 2.

        Parameters:
        n - the number of compute threads to use
        Returns:
        this
      • blockingExecutor

        ExecControllerSpec blockingExecutor​(java.util.function.Function<? super java.util.concurrent.ThreadFactory,​? extends java.util.concurrent.ExecutorService> factory)
        A factory for creating the executor to use for blocking tasks.

        It is essential that the executor uses the provided thread factory.

        By default, Executors.newCachedThreadPool() is used.

        Parameters:
        factory - the creator of the thread factory
        Returns:
        this
      • execInitializers

        ExecControllerSpec execInitializers​(java.lang.Iterable<? extends ExecInitializer> initializers)
        The exec initializers to use for initializing executions.
        Parameters:
        initializers - the exec initializers to use for initializing executions
        Returns:
        this
      • execInterceptors

        ExecControllerSpec execInterceptors​(java.lang.Iterable<? extends ExecInterceptor> interceptors)
        The exec interceptors to use for intercepting executions.
        Parameters:
        interceptors - exec interceptors to use for intercepting executions
        Returns:
        this
      • contextClassLoader

        ExecControllerSpec contextClassLoader​(java.lang.ClassLoader classLoader)
        The context classloader to initialize threads with.

        Defaults to the current context classloader of the thread that created this.

        Parameters:
        classLoader - the context classloader to initialize threads with
        Returns:
        this