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

asynchronous evaluate #819

Merged
merged 3 commits into from
Oct 20, 2016

Conversation

rosshinkley
Copy link
Contributor

This PR is intended to let you run .evaluate()d functions that are asynchronous, either with callbacks or with promises. For callbacks, if the .evaluate()d function's arity is one less than the passed in parameters, it'll assume the last argument to the function is the callback. If the return value is a thenable, it'll call then() to wait for promise fulfillment. Otherwise, the call will behave synchronously as it does now.

This change is potentially breaking as it does change behavior based on the arguments to .evaluate(). Is this change worth the risk of possibly breaking implementations that already exist?

Related to #573 and closes #552.

@xat
Copy link

xat commented Oct 9, 2016

This feature would be really awesome!

@bchr02
Copy link
Contributor

bchr02 commented Oct 12, 2016

@rosshinkley this pull request is great! Thank you. It will help me with #830

@rosshinkley rosshinkley added this to the 2.8.0 milestone Oct 20, 2016
@rosshinkley
Copy link
Contributor Author

Including. Thanks for the feedback. :)

@rosshinkley rosshinkley merged commit be4fcf9 into segment-boneyard:master Oct 20, 2016
@bitnom
Copy link

bitnom commented Sep 30, 2017

I think this PR can help me. Can someone please show me an example of how to resolve this? #1279

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

Successfully merging this pull request may close these issues.

Wait for promise to settle in document
4 participants