java.lang.Object | ||
↳ | com.facebook.imagepipeline.producers.NetworkFetchProducer<RS extends com.facebook.imagepipeline.producers.NfpRequestState> | |
↳ | com.facebook.imagepipeline.backends.okhttp.OkHttpNetworkFetchProducer |
Network fetch producer using OkHttp as a backend.
OkHttpNetworkFetchProducer supports request cancellation. This feature is enabled
via cancellable
constructor parameter.
For example of usage see com.facebook.fresco.sample.adapters.FrescoOkHttpAdapter
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
OkHttpNetworkFetchProducer(OkHttpClient okHttpClient, boolean cancellable, PooledByteBufferFactory pooledByteBufferFactory, ByteArrayPool byteArrayPool) |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
fetchImage(NfpRequestState requestState)
Subclasses should override this method to actually call their network stack.
| ||||||||||
NfpRequestState |
newRequestState(Consumer<CloseableReference<PooledByteBuffer>> consumer, ProducerContext context)
Returns an instance of the
NfpRequestState -derived object used to store state. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
okHttpClient | client to use |
---|---|
cancellable | whether to allow cancellation of submitted requests |
pooledByteBufferFactory | pooled byte buffer factory |
byteArrayPool | pool for stream input/ouptut buffering |
Subclasses should override this method to actually call their network stack.
It is strongly recommended that this method be asynchronous.
Returns an instance of the NfpRequestState
-derived object used to store state.