Package org.littleshoot.proxy.impl
Class ThreadPoolConfiguration
java.lang.Object
org.littleshoot.proxy.impl.ThreadPoolConfiguration
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 Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate intprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintintwithAcceptorThreads(int acceptorThreads) Set the number of acceptor threads to create.withClientToProxyWorkerThreads(int clientToProxyWorkerThreads) Set the number of client-to-proxy worker threads to create.withProxyToServerWorkerThreads(int proxyToServerWorkerThreads) Set the number of proxy-to-server worker threads to create.
-
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
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
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
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
-