seatgeek / SGImageCache

A flexible image caching library for image rich iOS applications
BSD 2-Clause "Simplified" License
401 stars 36 forks source link

When the network is unreachable, no completion is return. #8

Open pepsin opened 9 years ago

pepsin commented 9 years ago

This cause some loading into eternity. And makes user feels weird. I want to know is there an approachable solution for this.

I am currently trying to implement this feature. So I want to know what do you think about this.

sobri909 commented 9 years ago

Hm. It looks like it'll only call the completion (with a nil image) if it was a 404. Otherwise it'll retry.

I'm inclined to prefer leaving it for retry rather than doing an explicit fail and removing it from the queue. If it's left to be retried, then it will eventually succeed once the network is reachable again.

Though it makes sense that we should throw catch promises on failure, so that any code that wants to be informed can be so. So yeah, I think that's the way to go. How to implement that, I'm not sure. I'm not greatly familiar with PromiseKit yet.