public interface LoadBalancedConnection extends ScoreSupplier, ReservableRequestConcurrencyController, ListenableAsyncCloseable
LoadBalancer.RequestConcurrencyController.Result| Modifier and Type | Method and Description |
|---|---|
default Completable |
releaseAsync()
Must be called (and subscribed to) to signify the reservation has completed after
ReservableRequestConcurrencyController.tryReserve(). |
default void |
requestFinished()
Must be called after
RequestConcurrencyController.tryRequest() to signify the request has completed. |
default RequestConcurrencyController.Result |
tryRequest()
Attempts to reserve a connection for a single request, needs to be followed by
RequestConcurrencyController.requestFinished(). |
default boolean |
tryReserve()
Attempts to reserve a connection for exclusive use until
ReservableRequestConcurrencyController.releaseAsync() is called. |
scoredefault RequestConcurrencyController.Result tryRequest()
RequestConcurrencyControllerRequestConcurrencyController.requestFinished().tryRequest in interface RequestConcurrencyControllerRequestConcurrencyController.Result.Accepted if this connection is available and reserved for performing a single request.default void requestFinished()
RequestConcurrencyControllerRequestConcurrencyController.tryRequest() to signify the request has completed. This method should be called
no more than once for each call to RequestConcurrencyController.tryRequest().
Generally called from a Publisher.beforeFinally(Runnable) after a RequestConcurrencyController.tryRequest().
requestFinished in interface RequestConcurrencyControllerdefault boolean tryReserve()
ReservableRequestConcurrencyControllerReservableRequestConcurrencyController.releaseAsync() is called.tryReserve in interface ReservableRequestConcurrencyControllertrue if this connection is available and reserved for performing a single request.default Completable releaseAsync()
ReservableRequestConcurrencyControllerReservableRequestConcurrencyController.tryReserve().releaseAsync in interface ReservableRequestConcurrencyControllerCompletable for the release.