示例#1
0
        /// <summary>
        /// swallow-result -> background-thread hand-off -> multiplex ->
        /// encoded cache -> disk cache -> (webp transcode) -> network fetch.
        /// </summary>
        private IProducer <object> GetNetworkFetchToEncodedMemoryPrefetchSequence()
        {
            lock (_gate)
            {
                if (_networkFetchToEncodedMemoryPrefetchSequence == null)
                {
                    _networkFetchToEncodedMemoryPrefetchSequence =
                        ProducerFactory.NewSwallowResultProducer(
                            GetBackgroundNetworkFetchToEncodedMemorySequence());
                }

                return(_networkFetchToEncodedMemoryPrefetchSequence);
            }
        }
示例#2
0
        /// <summary>
        /// swallow result producer -> inputProducer
        /// </summary>
        private IProducer <object> GetDecodedImagePrefetchSequence(

            IProducer <CloseableReference <CloseableImage> > inputProducer)
        {
            lock (_gate)
            {
                if (!_closeableImagePrefetchSequences.ContainsKey(inputProducer))
                {
                    SwallowResultProducer <CloseableReference <CloseableImage> > swallowResultProducer =
                        ProducerFactory.NewSwallowResultProducer(inputProducer);

                    _closeableImagePrefetchSequences.Add(inputProducer, swallowResultProducer);
                }

                var producer = default(IProducer <object>);
                _closeableImagePrefetchSequences.TryGetValue(inputProducer, out producer);
                return(producer);
            }
        }