in pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/internal/api/InflightLimiter.java [90:102]
public InflightLimiter(int maxInflight, int expectedSubscriptionsInflight, Scheduler triggerNextScheduler,
int maxPendingSubscriptions) {
if (maxInflight < 1) {
throw new IllegalArgumentException("maxInflight must be greater than 0");
}
this.maxInflight = maxInflight;
this.expectedSubscriptionsInflight = expectedSubscriptionsInflight;
this.triggerNextWorker = triggerNextScheduler.createWorker();
if (expectedSubscriptionsInflight > maxInflight) {
throw new IllegalArgumentException("maxSubscriptionInflight must be equal or less than maxInflight.");
}
this.pendingSubscriptions = new MpmcArrayQueue<>(maxPendingSubscriptions);
}