-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing Priority of download-dataTask after it started #73
Comments
This would be a huge improvement! 👍 |
Also is there a reason for just toggling between |
Yes, I a agree. That feature would be very useful. |
The original implementation hides the And for changing the priority on air when downloading, the downloader APIs (as well as the image view extension APIs) are returning a image task. We could just expose the |
Really looking forward to this improvement! |
Implemented in #194 |
Nice! Can't wait until it gets released! |
It will be released later as a part of version 2.0.0. |
Great! |
Hi,
since I prefetch a lot of images, but want to show a couple of images as fast as possible, I just looked into prioritization of Kingfisher. Looks quite good to me, besides one point: it's not possible to change the priority of a download, once it's started.
As an example: I start to download the images cat[1-100].png and dog[1-100].png. They are all priorized as low since its only prefetching. Now I open the cat view which has a tableView with cat images. So I want to set a couple of images (of the visible cells) via UIImageViews kf_setImageWithURL. Since there are 200 images currently downloading, I need a higher prioritization for the images cat1.png - cat5.png.
But since they are part of the batch download of the prefetching, their url is already in self.fetchLoads in ImageDownloader and hence the started-closure is not called again in line 214 and "task.priority" is not changed to default, although the options dictionary in the downloadImageWithURL-call does not contain the lowPriority option.
A solution could be to attach the downloadTask to the ImageFetchLoad. In this case, it would be also possible to provide auto-priorisation (the more callbacks are attached to the ImageFetchLoad, the higher the priority could be. Some rewrite of ImageDownloader would be needed.
What do you think?
Best regards,
Matt
The text was updated successfully, but these errors were encountered: