LoaderQueue

1 view
Skip to first unread message

Ben McMaster

unread,
Aug 20, 2009, 3:29:28 PM8/20/09
to bumpslide
In my current project, I am catching a lot of IOErrors on both Loaders
and UrlLoaders. Right off the bat our app is loading XML, a video, 1
large photo, about 100 thumbnails. About half the time we start up the
app, loading errors crop up...not all the thumbnails load, or the big
photo doesn't load... It is always inconsistent.

Unfortunately, we are not using the bumpslide code (even though I
tried to sell it.) But I was looking at LoaderQueue. I am a little
lost. What is main concepts that you are going for there? Would that
be something like that help my problem?

I was thinking about something that would try loading, catch an error
or time out, then retrying...

Thank you!

/ben

David Knape

unread,
Aug 20, 2009, 7:42:57 PM8/20/09
to bump...@googlegroups.com
My LoaderQueue simply enqueues Loader requests. You give it a Loader
instance, and tell it what URL to load and an optional priority and
loadingContext. There is a prioritized queue inside that handles
errors and advances the queue as neeeded. It's also "threaded" so, it
will load 4 at a time by default. See the Image UI Component for
implementation. The reason this is useful if for the issue you
described. Sending out all those HTTP requests at once just causes
problems sometimes.

RequestQueue is similar in that it is based on the same queue class,
but it is for IRequest instances. I use this for everything except
images/swfs. It does have retry functionality. The LoaderQueue does
not. Also, notes that you will need to keep a static/global instance
of the loader queue, as it is not a singleton by design.

Meanwhile, for your purposes, I would check out BulkLoader.
http://code.google.com/p/bulk-loader/

BulkLoader is nice because there aren't a lot of dependencies. It's
not my favorite API, but it seems to work well, and it's good at
handling one big queue for multiple content types.

-dk

Ben McMaster

unread,
Aug 21, 2009, 5:15:31 PM8/21/09
to bumpslide
Thanks for the reply! I will check out the bulk loader if needed. It
looks pretty cool.

As for now, yesterday I think I came up with a quick solution that is
working pretty good, surprisingly. For now I am focusing on loading
the thumbnail grids.

I make a 2 second timer that starts in the load function. The timer is
reset in the onProgress function. I stop the timer in the onComplete.
If the timer runs out, I close the loader and retry loading it. I
allow it to retry 3 times. So basically if the load hangs at any
point, it will close and retry. So far it fixed all of the issues that
we were seeing. Pretty cool.

What do you think of that approach?

/ben

On Aug 20, 4:42 pm, David Knape <tkd...@gmail.com> wrote:
> My LoaderQueue simply enqueues Loader requests.  You give it a Loader
> instance, and tell it what URL to load and an optional priority and
> loadingContext.  There is a prioritized queue inside that handles
> errors and advances the queue as neeeded.  It's also "threaded" so, it
> will load 4 at a time by default.  See the Image UI Component for
> implementation.  The reason this is useful if for the issue you
> described.  Sending out all those HTTP requests at once just causes
> problems sometimes.
>
> RequestQueue is similar in that it is based on the same queue class,
> but it is for IRequest instances.  I use this for everything except
> images/swfs.  It does have retry functionality.  The LoaderQueue does
> not.  Also, notes that you will need to keep a static/global instance
> of the loader queue, as it is not a singleton by design.
>
> Meanwhile, for your purposes, I would check out BulkLoader.http://code.google.com/p/bulk-loader/
Reply all
Reply to author
Forward
0 new messages