io.vrap.rmf.base.client.http.QueueRequestMiddleware Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rmf-java-base Show documentation
Show all versions of rmf-java-base Show documentation
The e-commerce SDK from commercetools Composable Commerce for Java
package io.vrap.rmf.base.client.http;
import java.time.Duration;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ScheduledExecutorService;
import dev.failsafe.spi.Scheduler;
/**
* Middleware to limit the number of concurrent request using a Queue
*
* @include.example io.vrap.rmf.base.client.QueueMiddlewareTest#queueConfiguration()
*
* @deprecated use {@link PolicyMiddleware} instead
*/
@Deprecated
public interface QueueRequestMiddleware extends Middleware {
public static QueueRequestMiddleware of(final ExecutorService executorService, final int maxRequests,
final Duration maxWaitTime) {
return new QueueMiddleware(executorService, maxRequests, maxWaitTime);
}
public static QueueRequestMiddleware of(final ScheduledExecutorService executorService, final int maxRequests,
final Duration maxWaitTime) {
return new QueueMiddleware(executorService, maxRequests, maxWaitTime);
}
public static QueueRequestMiddleware of(final Scheduler scheduler, final int maxRequests,
final Duration maxWaitTime) {
return new QueueMiddleware(scheduler, maxRequests, maxWaitTime);
}
public static QueueRequestMiddleware of(final int maxRequests, final Duration maxWaitTime) {
return new QueueMiddleware(maxRequests, maxWaitTime);
}
}