- java.lang.Object
-
- com.github.mizosoft.methanol.internal.flow.Prefetcher
-
public final class Prefetcher extends java.lang.ObjectAn object that manages requests to an upstream subscription according to a prefetching policy. Callers callinitialize(Upstream)when they first receive the subscription andupdate(Upstream)when a received item is consumed. The prefetching policy ensures that the number of requested but not fulfilled items remains between two values, namelyprefetchThresholdandprefetch.This class is not thread-safe. Caller must ensure that
initialize(Upstream)&update(Upstream)are not interleaved and are properly synchronized.
-
-
Constructor Summary
Constructors Constructor Description Prefetcher()Prefetcher(int prefetch, int prefetchThreshold)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitialize(Upstream upstream)voidupdate(Upstream upstream)
-