Skip to content
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

Removing an item in the complete handler can stall BulkLoader #141

Open
divillysausages opened this issue Mar 7, 2014 · 0 comments
Open

Comments

@divillysausages
Copy link

If, in the onComplete handler of an item, you call remove() on it, BulkLoader can stall. It comes from _onItemComplete being added using int.MIN_VALUE:

item.addEventListener(Event.COMPLETE, _onItemComplete, false, int.MIN_VALUE, true);

To fix it, either set the priority to int.MAX_VALUE, or update the remove() function to include:

if(allDone) {
    _onAllLoaded();
}
else if ( !_isPaused )
{
    // this needs to try to load a next item, because this might get called inside a
    // complete handler and if it's on the last item on the open connections, it might stale
    _loadNext();
}

I'm more for the latter solution, as it's already used in a number of places in the file to combat the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant