public abstract class

MultiplexProducer

extends Object
implements Producer<T>
java.lang.Object
   ↳ com.facebook.imagepipeline.producers.MultiplexProducer<K, T extends java.io.Closeable>
Known Direct Subclasses

Class Overview

Producer for combining multiple identical requests into a single request.

Requests using the same key will be combined into a single request. This request is only cancelled when all underlying requests are cancelled, and returns values to all underlying consumers. If the request has already return one or more results but has not finished, then any requests with the same key will have the most recent result returned to them immediately.

Summary

Constants
String EXTRAS_STARTED_AS_PREFETCH
Protected Constructors
MultiplexProducer(Producer<T> inputProducer, String producerName, String dedupedRequestsCountKey)
MultiplexProducer(Producer<T> inputProducer, String producerName, String dedupedRequestsCountKey, boolean keepCancelledFetchAsLowPriority)
Public Methods
void produceResults(Consumer<T> consumer, ProducerContext context)
Start producing results for given context.
Protected Methods
abstract T cloneOrNull(T object)
synchronized Multiplexer getExistingMultiplexer(K key)
abstract K getKey(ProducerContext producerContext)
synchronized void removeMultiplexer(K key, Multiplexer multiplexer)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.facebook.imagepipeline.producers.Producer

Constants

public static final String EXTRAS_STARTED_AS_PREFETCH

Constant Value: "started_as_prefetch"

Protected Constructors

protected MultiplexProducer (Producer<T> inputProducer, String producerName, String dedupedRequestsCountKey)

protected MultiplexProducer (Producer<T> inputProducer, String producerName, String dedupedRequestsCountKey, boolean keepCancelledFetchAsLowPriority)

Public Methods

public void produceResults (Consumer<T> consumer, ProducerContext context)

Start producing results for given context. Provided consumer is notified whenever progress is made (new value is ready or error occurs).

Protected Methods

protected abstract T cloneOrNull (T object)

protected synchronized Multiplexer getExistingMultiplexer (K key)

protected abstract K getKey (ProducerContext producerContext)

protected synchronized void removeMultiplexer (K key, Multiplexer multiplexer)