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

rejection/resolution of rejected/resoved promise must throw #3

Closed
Gozala opened this issue Oct 25, 2010 · 3 comments
Closed

rejection/resolution of rejected/resoved promise must throw #3

Gozala opened this issue Oct 25, 2010 · 3 comments

Comments

@Gozala
Copy link
Collaborator

Gozala commented Oct 25, 2010

It could be that my expectations are just wrong, but I was assuming that resolving or rejecting a promise that was already resolved or rejected will throw exception. In any case here are the tests

http://github.com/kriskowal/q/pull/1#L4R62
http://github.com/kriskowal/q/pull/1#L4R97

In case behavior is expected we can change tests accordingly.

@kriskowal
Copy link
Owner

The behavior is expected; the idea is that promises need to be a uni-directional communication channel for security reasons. For example, a dozen consumers might be given the same resolver so that they can race to provide the resolution, but they should not be able to observe whether they won the race. That's what I heard from Tyler Close or Mark Miller anyway.

Thanks for the cases. I'll have more time to do integration for a while.

@Gozala
Copy link
Collaborator Author

Gozala commented Oct 27, 2010

Ok I'll update test cases accordingly and will include them into the pull request

@Gozala
Copy link
Collaborator Author

Gozala commented Nov 3, 2010

This issue was closed.
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