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

Wait for promise to resolve regardless of loop being stopped #1315

Merged
merged 1 commit into from
Apr 26, 2019

Conversation

Grinnz
Copy link
Contributor

@Grinnz Grinnz commented Jan 29, 2019

Summary

Ensure that wait will keep running the loop until the promise is no longer pending.

Motivation

Calling wait can result in a still-pending promise even if the loop is not running, as anything may stop the loop. This small change ensures that it will not return while the promise is pending, which is the documented behavior and user expectation. This is also important for the proposed get method(s), to ensure it does not return before the results are available.

References

Prior art: the implementations of await and get in Future event loop subclasses will loop until the Future is no longer pending.

@kraih
Copy link
Member

kraih commented Apr 26, 2019

Wanted to merge this PR, but there are now conflicts.

@Grinnz
Copy link
Contributor Author

Grinnz commented Apr 26, 2019

Rebased

@kraih kraih merged commit 98c050f into mojolicious:master Apr 26, 2019
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

Successfully merging this pull request may close these issues.

2 participants