Package io.vrap.rmf.base.client.http
Class QueueMiddleware
java.lang.Object
io.vrap.rmf.base.client.http.QueueMiddleware
- All Implemented Interfaces:
Middleware
,QueueRequestMiddleware
,AutoCloseable
@Deprecated
public class QueueMiddleware
extends Object
implements QueueRequestMiddleware, AutoCloseable
Deprecated.
Implementation of a Queue to limit the number of concurrent requests handled by the client
final ApiHttpClient build = ClientBuilder.of() // ... .addMiddleware(new QueueMiddleware(64, Duration.ofSeconds(10))) .build();
See the test code.
-
Constructor Summary
ConstructorDescriptionQueueMiddleware
(int maxConnection, Duration maxWaitTime) Deprecated.QueueMiddleware
(dev.failsafe.spi.Scheduler scheduler, int maxConnections, Duration maxWaitTime) Deprecated.QueueMiddleware
(ExecutorService executorService, int maxConnection, Duration maxWaitTime) Deprecated.QueueMiddleware
(ScheduledExecutorService executorService, int maxConnection, Duration maxWaitTime) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Deprecated.CompletableFuture<ApiHttpResponse<byte[]>>
invoke
(ApiHttpRequest request, Function<ApiHttpRequest, CompletableFuture<ApiHttpResponse<byte[]>>> next) Deprecated.
-
Constructor Details
-
QueueMiddleware
Deprecated. -
QueueMiddleware
public QueueMiddleware(ScheduledExecutorService executorService, int maxConnection, Duration maxWaitTime) Deprecated. -
QueueMiddleware
Deprecated. -
QueueMiddleware
public QueueMiddleware(dev.failsafe.spi.Scheduler scheduler, int maxConnections, Duration maxWaitTime) Deprecated.
-
-
Method Details
-
invoke
public CompletableFuture<ApiHttpResponse<byte[]>> invoke(ApiHttpRequest request, Function<ApiHttpRequest, CompletableFuture<ApiHttpResponse<byte[]>>> next) Deprecated.- Specified by:
invoke
in interfaceMiddleware
-
close
public void close()Deprecated.- Specified by:
close
in interfaceAutoCloseable
-
PolicyMiddleware
instead