Ejemplo n.º 1
0
        /// <summary>
        /// background-thread hand-off -> multiplex -> encoded cache ->
        /// disk cache -> (webp transcode) -> network fetch.
        /// </summary>
        private IProducer <EncodedImage> GetBackgroundNetworkFetchToEncodedMemorySequence()
        {
            lock (_gate)
            {
                if (_backgroundNetworkFetchToEncodedMemorySequence == null)
                {
                    // Use hand-off producer to ensure that we don't do any unnecessary work
                    // on the UI thread.
                    _backgroundNetworkFetchToEncodedMemorySequence =
                        _producerFactory.NewBackgroundThreadHandoffProducer(
                            GetCommonNetworkFetchToEncodedMemorySequence(),
                            _threadHandoffProducerQueue);
                }

                return(_backgroundNetworkFetchToEncodedMemorySequence);
            }
        }