-
Notifications
You must be signed in to change notification settings - Fork 107
[API Breaking] Separate wait_for into two methods: wait_for_any and wait_until #174
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
cefc785
Refactor wait_for into distinct wait_for_any and wait_for_condition m…
jeffschoner-stripe b402bf3
Check finished? on wait_for_any, add more unit specs
jeffschoner-stripe 51e2772
Remove dead code, improve error messages in local workflow context
jeffschoner-stripe 5e7bd9d
Update new examples to use wait_for_any, wait_until
jeffschoner-stripe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The change makes sense and clarifies a lot of things, thank you @jeffschoner-stripe . One thing I'm not sure — why not use the original
wait_forhere? My brain thinks thatwait_untilsuggests a time argument, but it might be just me :)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 had originally called this
wait_for_conditionbut the until language seemed more similar to the Rubyuntilkeyword.I didn't want to preserve
wait_forbecause if someone is using that with a block today, removing the block from the signature is not breaking. Their code would just start silently ignoring the block condition. For example, if they were callingwait_for(timeout_timer_future) { some_variable }, removing the block argument from the function would have the effect of just waiting for the timeout and ignoring the condition.However, if
wait_forgoes away entirely, it will immediately break their code once upgrading to the new version. I could also do leave thewait_forthere but mark it as deprecated or leave it there to only raise an error explaining that the new functions should be used instead. What do you think? Unfortunately, I don't have a clear picture of who may be using these APIs today.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 suppose I could also keep calling it
wait_forand have it only take the condition block. That would be breaking, and I could add an explanatory commentThere 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 think approach here is clearer. It seems better to have the method completely go away, so that any breakage would be resolved by looking for this PR or by reading comments on workflow context.