java.lang.Object | |
↳ | com.facebook.imagepipeline.producers.PriorityNetworkFetcher<FETCH_STATE extends com.facebook.imagepipeline.producers.FetchState> |
PriorityNetworkFetcher fetches images using a priority queue.
Fetches are delegated to another fetcher.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | PriorityNetworkFetcher.NonrecoverableException | The delegate fetcher may pass an instance of this exception to its callback's onFailure to signal to a PriorityNetworkFetcher that it shouldn't retry that request. | |||||||||
class | PriorityNetworkFetcher.PriorityFetchState<FETCH_STATE extends FetchState> |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
public static final String | TAG |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PriorityNetworkFetcher(NetworkFetcher<FETCH_STATE> delegate, boolean isHiPriFifo, int maxOutstandingHiPri, int maxOutstandingLowPri, boolean inflightFetchesCanBeCancelled, boolean infiniteRetries) | |||||||||||
PriorityNetworkFetcher(NetworkFetcher<FETCH_STATE> delegate, boolean isHiPriFifo, int maxOutstandingHiPri, int maxOutstandingLowPri, boolean inflightFetchesCanBeCancelled, boolean infiniteRetries, MonotonicClock clock) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PriorityFetchState<FETCH_STATE> |
createFetchState(Consumer<EncodedImage> consumer, ProducerContext producerContext)
Creates a new instance of the
FetchState -derived object used to store state. | ||||||||||
void | fetch(PriorityFetchState<FETCH_STATE> fetchState, NetworkFetcher.Callback callback) | ||||||||||
Map<String, String> | getExtraMap(PriorityFetchState<FETCH_STATE> fetchState, int byteSize) | ||||||||||
void | onFetchCompletion(PriorityFetchState<FETCH_STATE> fetchState, int byteSize) | ||||||||||
void |
pause()
Stop dequeuing requests until
resume() is called. | ||||||||||
void |
resume()
Resume dequeuing requests.
| ||||||||||
boolean | shouldPropagate(PriorityFetchState<FETCH_STATE> fetchState) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.facebook.imagepipeline.producers.NetworkFetcher
|
isHiPriFifo | if true, hi-pri requests are dequeued in the order they were enqueued. Otherwise, they're dequeued in reverse order. |
---|---|
inflightFetchesCanBeCancelled | if false, the fetcher waits for the completion of requests that have been delegated to 'delegate' even if they were cancelled by Fresco. The cancellation order is not propagated to 'delegate', and no other request is dequeued. |
infiniteRetries | if true, requests that fail are re-queued, potentially retrying immediately. |
Creates a new instance of the FetchState
-derived object used to store state.
consumer | the consumer |
---|---|
producerContext | the producer's context |
Resume dequeuing requests.
Note: a request is immediately dequeued and the delegate's fetch() method is called using the current thread.