Package ratpack.exec

Interface ExecControllerBuilder

    • Method Detail

      • numThreads

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

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

        Specified by:
        numThreads in interface ExecControllerSpec
        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:
        contextClassLoader in interface ExecControllerSpec
        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:
        blockingThreadIdleTimeout in interface ExecControllerSpec
        Parameters:
        idleTimeout - the duration to allow a non-core blocking thread to remain in the pool before terminating it
        Returns:
        this
      • build

        ExecController build()
        Creates a controller from the current state.
        Returns:
        a controller from the current state