Package org.littleshoot.proxy.impl
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 NettyEventLoopGroupused by the proxy.
-
-
Field Summary
Fields Modifier and Type Field Description private intacceptorThreadsprivate intclientToProxyWorkerThreadsprivate intproxyToServerWorkerThreads
-
Constructor Summary
Constructors Constructor Description ThreadPoolConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAcceptorThreads()intgetClientToProxyWorkerThreads()intgetProxyToServerWorkerThreads()ThreadPoolConfigurationwithAcceptorThreads(int acceptorThreads)Set the number of acceptor threads to create.ThreadPoolConfigurationwithClientToProxyWorkerThreads(int clientToProxyWorkerThreads)Set the number of client-to-proxy worker threads to create.ThreadPoolConfigurationwithProxyToServerWorkerThreads(int proxyToServerWorkerThreads)Set the number of proxy-to-server worker threads to create.
-
-
-
Method Detail
-
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 isServerGroup.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 isServerGroup.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 isServerGroup.DEFAULT_OUTGOING_WORKER_THREADS.- Parameters:
proxyToServerWorkerThreads- number of proxy-to-server worker threads to create- Returns:
- this thread pool configuration instance, for chaining
-
-