Class ReservableRequestConcurrencyControllers
- java.lang.Object
-
- io.servicetalk.client.api.internal.ReservableRequestConcurrencyControllers
-
public final class ReservableRequestConcurrencyControllers extends java.lang.ObjectFactory for commonReservableRequestConcurrencyControllers.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ReservableRequestConcurrencyControllernewController(Publisher<? extends ConsumableEvent<java.lang.Integer>> maxConcurrency, Completable onClosing, int initialMaxConcurrency)Create a new instance ofReservableRequestConcurrencyController.static ReservableRequestConcurrencyControllernewSingleController(Publisher<? extends ConsumableEvent<java.lang.Integer>> maxConcurrency, Completable onClosing)Create aReservableRequestConcurrencyControllerthat only allows a single outstanding request.
-
-
-
Method Detail
-
newController
public static ReservableRequestConcurrencyController newController(Publisher<? extends ConsumableEvent<java.lang.Integer>> maxConcurrency, Completable onClosing, int initialMaxConcurrency)
Create a new instance ofReservableRequestConcurrencyController.- Parameters:
maxConcurrency- APublisherthat provides the maximum allowed concurrency updates.onClosing- ACompletablethat when terminated no more calls toRequestConcurrencyController.tryRequest()are expected to succeed.initialMaxConcurrency- The initial maximum value for concurrency, untilmaxConcurrencySettingprovides data.- Returns:
- a new instance of
ReservableRequestConcurrencyController.
-
newSingleController
public static ReservableRequestConcurrencyController newSingleController(Publisher<? extends ConsumableEvent<java.lang.Integer>> maxConcurrency, Completable onClosing)
Create aReservableRequestConcurrencyControllerthat only allows a single outstanding request. Even ifmaxConcurrencySettingincreases beyond1only a singleRequestConcurrencyController.tryRequest()will succeed at any given time. The initial value is assumed to be1and only lesser values frommaxConcurrencySettingwill impact behavior.- Parameters:
maxConcurrency- APublisherthat provides the maximum allowed concurrency updates. Only values of<1will impact behavior.onClosing- ACompletablethat when terminated no more calls toRequestConcurrencyController.tryRequest()are expected to succeed.- Returns:
- a
ReservableRequestConcurrencyControllerthat only allows a single outstanding request.
-
-