Class ReservableRequestConcurrencyControllers
java.lang.Object
io.servicetalk.client.api.internal.ReservableRequestConcurrencyControllers
Deprecated.
This class is not used by ServiceTalk internal code anymore and will be removed in the future releases.
If you depend on it, consider replicating this implementation in your codebase.
Factory for common
ReservableRequestConcurrencyController
s.-
Method Summary
Modifier and TypeMethodDescriptionnewController
(Publisher<? extends ConsumableEvent<Integer>> maxConcurrency, Completable onClosing, int initialMaxConcurrency) Deprecated.Create a new instance ofReservableRequestConcurrencyController
.newSingleController
(Publisher<? extends ConsumableEvent<Integer>> maxConcurrency, Completable onClosing) Deprecated.Create aReservableRequestConcurrencyController
that only allows a single outstanding request.
-
Method Details
-
newController
public static ReservableRequestConcurrencyController newController(Publisher<? extends ConsumableEvent<Integer>> maxConcurrency, Completable onClosing, int initialMaxConcurrency) Deprecated.Create a new instance ofReservableRequestConcurrencyController
.- Parameters:
maxConcurrency
- APublisher
that provides the maximum allowed concurrency updates.onClosing
- ACompletable
that when terminated no more calls toRequestConcurrencyController.tryRequest()
are expected to succeed.initialMaxConcurrency
- The initial maximum value for concurrency, untilmaxConcurrencySetting
provides data.- Returns:
- a new instance of
ReservableRequestConcurrencyController
.
-
newSingleController
public static ReservableRequestConcurrencyController newSingleController(Publisher<? extends ConsumableEvent<Integer>> maxConcurrency, Completable onClosing) Deprecated.Create aReservableRequestConcurrencyController
that only allows a single outstanding request. Even ifmaxConcurrencySetting
increases beyond1
only a singleRequestConcurrencyController.tryRequest()
will succeed at any given time. The initial value is assumed to be1
and only lesser values frommaxConcurrencySetting
will impact behavior.- Parameters:
maxConcurrency
- APublisher
that provides the maximum allowed concurrency updates. Only values of<1
will impact behavior.onClosing
- ACompletable
that when terminated no more calls toRequestConcurrencyController.tryRequest()
are expected to succeed.- Returns:
- a
ReservableRequestConcurrencyController
that only allows a single outstanding request.
-