Add ability to clear the queue #8

Closed
wants to merge 2 commits into from

3 participants

@bcooksey

Here is the queue removal broken out, per this pull

@gnarf
Owner

Do you think this should call abort on all the requests in the queue?

@gnarf
Owner

Also, could you make sure to add some documentation in the README.md on this? :)

@annabellor

The ability to clear the queue would be very nice.
In my opinion it should clear the entire queue (all the requests).

@bcooksey bcooksey Update README.md
Update the docs to describe the clearing functionality
c494d30
@bcooksey

Sorry for the delay on this, it fell off my radar. I could actually see providing an option to clear() that would let the caller decide whether the individual requests should be aborted as well. The particular use case I had for adding it was because i aggressively queued things (on change of a form), and at a certain point, wanted to drop all the pending requests without worrying about any callbacks being triggered.

@gnarf
Owner

This also won't cancel the currently running queue item, which might cause some problems whenever that request finishes, it will end up starting the next queued request and you'll have a concurrency of 2. I think we need .abort() to be able to do this correctly. Though having .clear() to just clear the queue is useful, I'd really prefer to see both together.

@gnarf
Owner

Closing for #13

@gnarf gnarf closed this Sep 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment