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

Get the promise status #35

Open
arcanis opened this issue Jun 26, 2012 · 1 comment
Open

Get the promise status #35

arcanis opened this issue Jun 26, 2012 · 1 comment

Comments

@arcanis
Copy link

arcanis commented Jun 26, 2012

Hi,

I'm currently writing a promised-based cache.

However, when calling 'save' on this cache, I can't know which are the resolved promises. I have two choices :

  • Waiting to complete every promise : it would be wrong, because the cache need to be saved now, that's the purpose of the function, and because if promise are created after calling save, then they won't be saved (consistancy issue).
  • Adding a flag to the promises manually when they are fullfilled. Not very clean.

Could it be possible to add to Deferred a getter of the current status ?

@SimoneTaliercio
Copy link

👍
I would need the same feature.
In my scenario there's a risk to call twice a _deferred.reject() because the nature of the application.
Is there a way other than using a flag?

Thanks!

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