Class ThreadPoolConfiguration

java.lang.Object
org.littleshoot.proxy.impl.ThreadPoolConfiguration

public class ThreadPoolConfiguration extends Object
Configuration object for the proxy's thread pools. Controls the number of acceptor and worker threads in the Netty EventLoopGroup used by the proxy.
  • Field Details

    • acceptorThreads

      private int acceptorThreads
    • clientToProxyWorkerThreads

      private int clientToProxyWorkerThreads
    • proxyToServerWorkerThreads

      private int proxyToServerWorkerThreads
  • Constructor Details

    • ThreadPoolConfiguration

      public ThreadPoolConfiguration()
  • Method Details

    • getClientToProxyWorkerThreads

      public int getClientToProxyWorkerThreads()
    • withClientToProxyWorkerThreads

      public ThreadPoolConfiguration withClientToProxyWorkerThreads(int clientToProxyWorkerThreads)
      Set the number of client-to-proxy worker threads to create. Worker threads perform the actual processing of client requests. The default value is ServerGroup.DEFAULT_INCOMING_WORKER_THREADS.
      Parameters:
      clientToProxyWorkerThreads - number of client-to-proxy worker threads to create
      Returns:
      this thread pool configuration instance, for chaining
    • getAcceptorThreads

      public int getAcceptorThreads()
    • withAcceptorThreads

      public ThreadPoolConfiguration withAcceptorThreads(int acceptorThreads)
      Set the number of acceptor threads to create. Acceptor threads accept HTTP connections from the client and queue them for processing by client-to-proxy worker threads. The default value is ServerGroup.DEFAULT_INCOMING_ACCEPTOR_THREADS.
      Parameters:
      acceptorThreads - number of acceptor threads to create
      Returns:
      this thread pool configuration instance, for chaining
    • getProxyToServerWorkerThreads

      public int getProxyToServerWorkerThreads()
    • withProxyToServerWorkerThreads

      public ThreadPoolConfiguration withProxyToServerWorkerThreads(int proxyToServerWorkerThreads)
      Set the number of proxy-to-server worker threads to create. Proxy-to-server worker threads make requests to upstream servers and process responses from the server. The default value is ServerGroup.DEFAULT_OUTGOING_WORKER_THREADS.
      Parameters:
      proxyToServerWorkerThreads - number of proxy-to-server worker threads to create
      Returns:
      this thread pool configuration instance, for chaining