in src/main/java/com/spotify/futures/ConcurrencyReducer.java [45:57]
private ConcurrencyReducer(int maxConcurrency, int maxQueueSize) {
this.maxConcurrency = maxConcurrency;
this.maxQueueSize = maxQueueSize;
if (maxConcurrency <= 0) {
throw new IllegalArgumentException("maxConcurrency must be at least 0");
}
if (maxQueueSize <= 0) {
throw new IllegalArgumentException("maxQueueSize must be at least 0");
}
this.queue = new ArrayBlockingQueue<>(maxQueueSize);
this.limit = new Semaphore(maxConcurrency);
}