Jump to content

Implementing Retry Logic When Loader Fails


arcbox
 Share

Recommended Posts

Hello,

 

I'm trying to implement some retry logic for when Loader fails to load an asset. Currently I've extended the Loader class, and I'm playing around with altering the fileError method to retry downloading the same asset if it fails, but I'm not quite sure what to add here.

 

Has anyone done anything like this before?

 

Thanks!

Link to comment
Share on other sites

  • 2 years later...

2 years later, I came across the same need for Loader retry.

A good solution seem to be to implement your own logic for keeping track of assets and updating them by subscribing to the 'load' and 'error' events. Then, at the end of the loader queue, create a new Loader, add only the failed assets and call load().

Alternatively, in case you want to retry for each asset immediately on fail, it may be possible to call directly the Resource's load function, but I haven't tested it and doesn't seem like a good solution.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...