I'm playing around with a method to fetch thumbnails via threads. Showing folders with a lot of pictures and movies and fetching thumbnails makes the user to wait for a long time.
Does someone has a working threaded solution for this kind of problem? Adding a Callback for a "thumb" gives me the problem how to return the result of a thread to the photo- or videoobject...
Hm, cannot get it work that the user does not have to wait while fetching thumbnails. A "Callback" this way will block the system for each fetch-call...
Ok. I think the next step is to check the xml generated for your list of objects by walking the XML tree using curl or a browser. Specifically, look at what sort of values are assigned to the 'thumb' attributes of each element.
Calling this function in a loop for a whole bunch of pictures:
... results in a very long time the user has to wait. "getThumb" does an json call to fetch a valid thumb url and returns it.
I think what's happening here is "normal" ... but it's not something we see all that much in typical channels because lots of times we are grabbing jpgs that are already in web pages or possibly cached, but also the calls are probably not throttled the way they would be with dropbox. So when you say "a bunch of images" how many do you mean? If there's 50 images then it's 50 separate HTTP calls for the JSON (assuming it takes a bit of time on their end to generate), parsing, and the another 50 HTTP calls to actually _load_ the jpgs themselves ... so however many images you're (at least) doubling the amount of HTTP calls and likely don't have any advantages of having anything cached. Just about anything doing that number of HTTP calls for a single "page" worth of content is likely going to take a long time.