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

Feature request - callback/promise interface on the queue itself #8

Open
istrasoft opened this issue May 13, 2014 · 11 comments
Open

Feature request - callback/promise interface on the queue itself #8

istrasoft opened this issue May 13, 2014 · 11 comments

Comments

@istrasoft
Copy link

I would like to request the ability to specify a callback/promise resolve function for the following events :

  • a queue completes all its requests > queue done
  • one of the requests failed > queue fail

and on the side note, it would be great to make the auto-send of requests an option, allowing to add some number of requests to a queue, and then "start" the queue at a later point.

@thedustinsmith
Copy link
Contributor

@istrasoft - I can see the ability to make the auto-send of requests an option, and the queue done/fail events used in conjunction, but separately they might be a little confusing.

If I don't use the auto-send, and add requests to a queue. Those requests finish and eventually I add additional requests to that same queue. Would the "queuedone" be fired multiple times?

@istrasoft
Copy link
Author

hi, thanks for the answer. The idea is to be able to attach a kind of .done() to the whole queue. If the requests are auto-sent, it would fire every time the last request completes, which is obviously less useful than if the requests are just queued and actually sent at a later point by something like queue.start(). of course they make most sense together

@istrasoft
Copy link
Author

While I'm at it, a small chunk to test for define and define.amd would be great too, to support AMD :)

@istrasoft
Copy link
Author

Hello, any news regarding this little thing @thedustinsmith please ?

@thedustinsmith
Copy link
Contributor

Sorry for the delay. I've been pretty busy. This seems like a nice feature to me, I'm just not sure I agree with the implementation described. At first glance, it seems to me that it would be better as something like $.ajaxq.onQueueComplete('queuename', function() {});

If you want to submit a pull request, I'd be happy to look at it and merge it in. As of right now, I won't be able to get to this for a couple weeks.

@istrasoft
Copy link
Author

No prob for the delay man !
you're right about the onQueueComplete, but then again it would only make sense if the requests can be queued without being launched right away IMHO

@thedustinsmith
Copy link
Contributor

100% agree on the manual launch. I like it, and I'll try to get to it soon.

As far as the define & AMD support, TBH, I don't have a lot of experience with either of them. I'd love to see it in a pull request, though.

@istrasoft
Copy link
Author

Ok I will fork & tinker ;)

@jagandecapri
Copy link
Contributor

@thedustinsmith I have made a pull request for AMD and CommonJS syntax support #20
Have a look at it. Cheers.

@thedustinsmith
Copy link
Contributor

Thanks for taking care of this @jagandecapri - I'll merge it in this week!

@jagandecapri
Copy link
Contributor

Great @thedustinsmith. 💯 While you at it, please make a release too for bower.

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

3 participants