public final class ReservableRequestConcurrencyControllers
extends java.lang.Object
ReservableRequestConcurrencyController
s.Modifier and Type | Method and Description |
---|---|
static ReservableRequestConcurrencyController |
newController(Publisher<? extends ConsumableEvent<java.lang.Integer>> maxConcurrency,
Completable onClosing,
int initialMaxConcurrency)
Create a new instance of
ReservableRequestConcurrencyController . |
static ReservableRequestConcurrencyController |
newSingleController(Publisher<? extends ConsumableEvent<java.lang.Integer>> maxConcurrency,
Completable onClosing)
Create a
ReservableRequestConcurrencyController that only allows a single outstanding request. |
public static ReservableRequestConcurrencyController newController(Publisher<? extends ConsumableEvent<java.lang.Integer>> maxConcurrency, Completable onClosing, int initialMaxConcurrency)
ReservableRequestConcurrencyController
.maxConcurrency
- A Publisher
that provides the maximum allowed concurrency updates.onClosing
- A Completable
that when terminated no more calls to
RequestConcurrencyController.tryRequest()
are expected to succeed.initialMaxConcurrency
- The initial maximum value for concurrency, until maxConcurrencySetting
provides data.ReservableRequestConcurrencyController
.public static ReservableRequestConcurrencyController newSingleController(Publisher<? extends ConsumableEvent<java.lang.Integer>> maxConcurrency, Completable onClosing)
ReservableRequestConcurrencyController
that only allows a single outstanding request. Even
if maxConcurrencySetting
increases beyond 1
only a single
RequestConcurrencyController.tryRequest()
will succeed at any given time. The initial value is assumed
to be 1
and only lesser values from maxConcurrencySetting
will impact behavior.maxConcurrency
- A Publisher
that provides the maximum allowed concurrency updates.
Only values of <1
will impact behavior.onClosing
- A Completable
that when terminated no more calls to
RequestConcurrencyController.tryRequest()
are expected to succeed.ReservableRequestConcurrencyController
that only allows a single outstanding request.