Interface ResourcePool
public interface ResourcePool
The resource pool a
RequestExecutionEngine run draws on for concurrency, throttle and
retries. Pass it to RequestEngineOptions.withResourcePool(ResourcePool). Obtain one
of three ways:
resourcePool()- a new private pool you can tune with thewithXmethods.defaultResourcePool()- Burp's shared default pool, used as-is.existingResourcePool(String)- a pool the user has already configured, by name.
The latter two reference pools whose settings are owned by Burp, so they are immutable:
calling a withX method on them throws IllegalStateException.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResourcePoolUse Burp's shared default resource pool as-is.static ResourcePoolexistingResourcePool(String name) Use a resource pool the user has already configured in Burp, identified by name, sharing its capacity with every other task assigned to it.static ResourcePoolObtain a new private, tunable resource pool at the default settings (concurrent request limit of10, no throttle, no retries).withConcurrentRequestLimit(int concurrentRequestLimit) Set the maximum number of requests sent concurrently from this pool.withMaxRetries(int maxRetries) Set the number of times a connection-level failure is retried before the request is recorded as failed.withThrottle(Duration delay) Set a fixed delay between consecutive requests across the run, capping the overall send rate regardless of concurrency.
-
Method Details
-
withConcurrentRequestLimit
Set the maximum number of requests sent concurrently from this pool.- Parameters:
concurrentRequestLimit- The maximum number of in-flight requests (in the range 1 to 999).- Returns:
- resource pool
- Throws:
IllegalArgumentException- ifconcurrentRequestLimitis outside the range 1 to 999.
-
withThrottle
Set a fixed delay between consecutive requests across the run, capping the overall send rate regardless of concurrency.- Parameters:
delay- The delay between requests.Duration.ZEROdisables throttling.- Returns:
- resource pool
- Throws:
IllegalArgumentException- ifdelayis null or negative.
-
withMaxRetries
Set the number of times a connection-level failure is retried before the request is recorded as failed. Only transport-level failures are retried; an HTTP 4xx or 5xx response is aRequestStatus.RESPONDEDanswer and is never retried.- Parameters:
maxRetries- The maximum number of retries per request (zero or more).- Returns:
- resource pool
- Throws:
IllegalArgumentException- ifmaxRetriesis negative.
-
resourcePool
Obtain a new private, tunable resource pool at the default settings (concurrent request limit of10, no throttle, no retries).- Returns:
- resource pool
-
defaultResourcePool
Use Burp's shared default resource pool as-is. The returned pool is immutable - itswithXmethods throwIllegalStateException.- Returns:
- resource pool
-
existingResourcePool
Use a resource pool the user has already configured in Burp, identified by name, sharing its capacity with every other task assigned to it. The returned pool is immutable - itswithXmethods throwIllegalStateException- and the run fails to start if no pool with that name exists.- Parameters:
name- The name of the existing resource pool.- Returns:
- resource pool
-