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

Promise synchronous polling #58

Open
johnhaley81 opened this issue Oct 28, 2014 · 2 comments
Open

Promise synchronous polling #58

johnhaley81 opened this issue Oct 28, 2014 · 2 comments

Comments

@johnhaley81
Copy link

I was wondering if I could change Promise to support something like bluebird's synchronous inspection. This would allow the user to inspect a promise to see if it's resolved and would not let them modify any internal values.

Originally I was going to do this as an extension but I think that'd I'd have to modify the lib/core.js file to really support this. I'd be willing to write this myself, it wouldn't be difficult.

@ForbesLindesay
Copy link
Member

I'm not sure if we should add that functionality to an intentionally minimal implementation. It is, in general, a footgun that makes it much easier to create code that relies on race conditions.

@johnhaley81
Copy link
Author

I was thinking about doing it as an extension originally, but the way that it's implemented makes it pretty awkward to do this.

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

No branches or pull requests

3 participants