Flux#limitRate(int, int) to publishers of outbound streams that
breaks down or aggregates demand values from the remote end (i.e. REQUEST_N frames) into
batches of a uniform size. For example the remote may request Long.MAXVALUE or it may
start requesting one at a time, in both cases with the limit set to 64, the publisher will see a
demand of 64 to start and subsequent batches of 48, i.e. continuing to prefetch and refill an
internal queue when it falls to 75% full. The high and low tide marks are configurable.
See static factory methods to create an instance for a requester or for a responder.
Note
keep in mind that the limitRate operator always uses requests
the same request values, even if the remote requests less than the limit. For example given a
limit of 64, if the remote requests 4, 64 will be prefetched of which 4 will be sent and 60 will
be cached.
| Modifier and Type | Class and Description |
|---|---|
| private class | LimitRateInterceptor.RequesterProxy
Requester side proxy, limits channel request stream. |
| private class | LimitRateInterceptor.ResponderProxy
Responder side proxy, limits response streams. |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final int | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public RSocket | apply(RSocket
the function argument socket)Implements java. |
| public static LimitRateInterceptor | Returns: the created interceptorthe prefetch rate to pass to prefetchRate)Flux#limitRate(int)Create an interceptor for an |
| public static LimitRateInterceptor | Returns: the created interceptorthe high tide value to pass to highTide, int Flux#limitRate(int, int)the low tide value to pass to lowTide)Flux#limitRate(int, int)Create an interceptor for an |
| public static LimitRateInterceptor | Returns: the created interceptorthe prefetch rate to pass to prefetchRate)Flux#limitRate(int)Create an interceptor for an |
| public static LimitRateInterceptor | Returns: the created interceptorthe high tide value to pass to highTide, int Flux#limitRate(int, int)the low tide value to pass to lowTide)Flux#limitRate(int, int)Create an interceptor for an |
| highTide | back to summary |
|---|---|
| private final int highTide | |
| lowTide | back to summary |
|---|---|
| private final int lowTide | |
| requesterProxy | back to summary |
|---|---|
| private final boolean requesterProxy | |
| LimitRateInterceptor | back to summary |
|---|---|
| private LimitRateInterceptor(int highTide, int lowTide, boolean requesterProxy) | |
| apply | back to summary |
|---|---|
| public RSocket apply(RSocket socket) Implements java. Doc from java. Applies this function to the given argument. | |
| forRequester | back to summary |
|---|---|
| public static LimitRateInterceptor forRequester(int prefetchRate) Create an interceptor for an
| |
| forRequester | back to summary |
|---|---|
| public static LimitRateInterceptor forRequester(int highTide, int lowTide) Create an interceptor for an
| |
| forResponder | back to summary |
|---|---|
| public static LimitRateInterceptor forResponder(int prefetchRate) Create an interceptor for an
| |
| forResponder | back to summary |
|---|---|
| public static LimitRateInterceptor forResponder(int highTide, int lowTide) Create an interceptor for an
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Flux | requestChannel(Publisher<Payload>
Stream of request payloads. payloads)Overrides io. Overrides default io. RSocket.
|
| RequesterProxy | back to summary |
|---|---|
| pack-priv RequesterProxy(RSocket source) | |
| requestChannel | back to summary |
|---|---|
| public Flux Overrides io. Overrides default io. Doc from io. Request-Channel interaction model of | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Flux | requestChannel(Publisher<Payload>
Stream of request payloads. payloads)Overrides io. Overrides default io. RSocket.
|
| public Flux | requestStream(Payload
Request payload. payload)Overrides io. Overrides default io. RSocket.
|
| ResponderProxy | back to summary |
|---|---|
| pack-priv ResponderProxy(RSocket source) | |
| requestChannel | back to summary |
|---|---|
| public Flux Overrides io. Overrides default io. Doc from io. Request-Channel interaction model of | |
| requestStream | back to summary |
|---|---|
| public Flux Overrides io. Overrides default io. Doc from io. Request-Stream interaction model of | |