-
Notifications
You must be signed in to change notification settings - Fork 576
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
Add Mojo::Promise handling to the eval command #1306
Conversation
4eaf550
to
33cfa31
Compare
33cfa31
to
7d1d96a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m in favor of this change 👍
I never had a need for this, so not sure how to vote. |
I had only rarely until a new project at $work. Since async functions necessarily return promises and since they nearly obviate the need for blocking apis I now have an app for which the model is entirely promises. I think once aa becomes more common this will be the case more and more often, it feels very natural |
b67fb23
to
9190b16
Compare
9190b16
to
52b272a
Compare
@marcusramberg I know you're on vacation, but if you get a second, I'd appreciate a review/vote |
Per the new PR policy, I'm calling a vote on this PR. @mojolicious/core |
Neutral vote from me. |
I'm also in favor of this change 👍 |
What do you think about adding a Usage example?
I don't know if this is a good example, but something like:
|
I find the eval command to be invaluable for one-off usage and testing, especially while developing. As I've been writing more promise apis and now as I'm writing fewer blocking apis due to the existence of Mojo::AsyncAwait, I'm finding the usage of promises in the eval command to be cumbersome to the point of not using it. With this change, one that I doubt would affect any usage in the wild (who wants to dump the stringified promise?), we can make a very comfortable interface for one-off testing of promise apis and make for easy examples and demos for newcomers or answer-seekers on irc.