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

cancel() with force parameter! #796

Closed
edvinv opened this issue Oct 6, 2015 · 1 comment
Closed

cancel() with force parameter! #796

edvinv opened this issue Oct 6, 2015 · 1 comment

Comments

@edvinv
Copy link

edvinv commented Oct 6, 2015

Hi,
I have a project with very complex promise structure that should be in some situation canceled from root promise. The problem is that it is very easy to forget marking a promise as cancellable but very difficult to find such a bug. So IMHO it will be very good to have additional force parameter in cancel method. Without it or when it is false it will work the same way as it is working now, but if you set it to true it will not only cancel promises that are marked as cancellable but also those that are not marked at all, but stop at promises marked as uncancellable. So you will now have an option not to mark promises as cancellable, but forcing cancellation with force parameter and only mark those points where you want to stop cancellation. This way there will be considerably less work in cases where all promises chain should be cancelled, because you will only have to call cancel() with true parameter and more importantly you will not have to worry that you forgot to call cancellable few months later when you add some additional promises to the chain.

thanks

@benjamingr
Copy link
Collaborator

Thanks for the feedback.

Promise cancellation is being overhauled for bluebird 3.0 to behave like the proposed ES standard cancellation and to be simpler and more robust.

see #415 , let us know if you have any issues with it.

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

2 participants