/// <summary> /// Start producing results for given context. /// Provided consumer is notified whenever progress is made /// (new value is ready or error occurs). /// </summary> public void ProduceResults(IConsumer <EncodedImage> consumer, IProducerContext context) { context.Listener.OnProducerStart(context.Id, PRODUCER_NAME); FetchState fetchState = _networkFetcher.CreateFetchState(consumer, context); _networkFetcher.Fetch(fetchState, new NetworkFetcherCallbackImpl( (response, responseLength) => { OnResponse(fetchState, response, responseLength); }, (throwable) => { OnFailure(fetchState, throwable); }, () => { OnCancellation(fetchState); })); }