Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Prepending tasks to the queue #136

wants to merge 1 commit into


None yet
4 participants

Not sure if it's completely correct or very useful or wasn't implemented already in some way, but at least works for me (and is terribly simple).
Useful for recursing (in a way) a task over the queue.

raszi commented on 41042bb Jun 3, 2012

I think it would be better to move it to a separated method instead of a new parameter. unshift sounds good for me.


HoverHell replied Jun 3, 2012

@raszi why? In my use case it's quite more convenient to have it as a parameter (I did make a separate method named “unshift” at first but then decided against it). And, is there a way to do that with DRY?

raszi replied Jun 3, 2012

Because it's more convenient, more readable.

You can extract the common inner parts and call that from both push and unshift.


HoverHell replied Jun 3, 2012

@raszi really, I don't see any better way than to make the “common inner parts” equal to the resulting “push” function.

raszi replied Jun 3, 2012

Look at this commit: raszi/async@e802dfa

tttp commented Aug 6, 2012

@HoverHell Was it a problem on @raszi code? Looks like the right solution, doesn't it?

@raszi, did you pull request your change to caolan?



raszi commented Aug 6, 2012

@tttp No, I did not. I'll rebase my commit and create a pull request soon.


raszi commented Aug 7, 2012

This can be closed by favor of #164


caolan commented Jan 31, 2013

A separate unshift method would be better.

@caolan caolan closed this Jan 31, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment