Techniques for limiting concurrent downloads via NSURLSession
Techniques for limiting concurrent downloads via NSURLSession
- Subject: Techniques for limiting concurrent downloads via NSURLSession
- From: Rick Mann <email@hidden>
- Date: Wed, 29 Jul 2015 16:46:37 -0700
In my application I have to download hundreds to maybe a thousand files for each "thing" that gets downloaded. I tried just kicking off a bunch of download tasks in a loop, but eventually I either get "Too many open files" errors, or I crash (this is on an iPad).
I can think of at least one way to limit this: issue the first N downloads, then as each completes, issue another. This requires a bit more bookkeeping, but can be doable.
The drawback comes when you want to make them background download sessions to be conducted when the app isn't running. It would be nice to set them all up, and just let the OS take care of limiting the actual downloads. Not sure this is feasible with this many files.
What other techniques do you guys use for this situation?
TIA,
--
Rick Mann
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden