java.lang.Object
com.github.mizosoft.methanol.internal.flow.Prefetcher
An object that manages requests to an upstream subscription according to a prefetching policy.
Callers call
initialize(Upstream)
when they first receive the subscription and update(Upstream)
when a received item is consumed. The prefetching policy ensures that the
number of requested but not fulfilled items remains between two values, namely
prefetchThreshold
and prefetch
.
This class is not thread-safe. Caller must ensure that initialize(Upstream)
&
update(Upstream)
are not interleaved and are properly synchronized.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Prefetcher
public Prefetcher() -
Prefetcher
public Prefetcher(int prefetch, int prefetchThreshold)
-
-
Method Details
-
initialize
-
update
-