Package io.servicetalk.client.api
Interface RequestConcurrencyController
- All Known Subinterfaces:
FilterableStreamingHttpLoadBalancedConnection,LoadBalancedConnection,ReservableRequestConcurrencyController
- All Known Implementing Classes:
DelegatingFilterableStreamingHttpLoadBalancedConnection,HttpLoadBalancerFactory.DefaultFilterableStreamingHttpLoadBalancedConnection
public interface RequestConcurrencyController
An interface which allows controlling reserving connections which maybe used concurrently.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidMust be called aftertryRequest()to signify the request has completed.Attempts to reserve a connection for a single request, needs to be followed byrequestFinished().
-
Method Details
-
tryRequest
RequestConcurrencyController.Result tryRequest()Attempts to reserve a connection for a single request, needs to be followed byrequestFinished().- Returns:
RequestConcurrencyController.Result.Acceptedif this connection is available and reserved for performing a single request.
-
requestFinished
void requestFinished()Must be called aftertryRequest()to signify the request has completed. This method should be called no more than once for each call totryRequest().Generally called from a
Publisher.beforeFinally(Runnable)after atryRequest().
-