-
Notifications
You must be signed in to change notification settings - Fork 226
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 support for "waiters" #623
Merged
Merged
Conversation
This file contains 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
8caf8eb
to
e3ca3ea
Compare
Waiters are a client-side abstraction used to poll a resource until a desired state is reached, or until it is determined that the resource will never enter into the desired state. Waiters have been available in AWS SDKs since around 2012, and are now part of Smithy as an additional specification. Note that this PR relies on smithy-jmespath.
e3ca3ea
to
1340cc9
Compare
This commit makes a few changes to waiters: 1. I removed and, or, and not. I couldn't think of a real use case for these as I was documenting them, so I am erring on the side of simplicity. 2. I removed the emptyArray comparator. This need more work to properly validate and specify it, and it can actually be acheived using a booleanEquals comparator by checking if a returned length of a value in JMESPath is equal to 0. No need for an extra comparator. 3. I added a new matcher named `inputOutput` that has two top level keys: input and output. This allows both input and output data to be queried *together* for successful operations, solving a longstanding use case we've had for things like making sure the number of autoscaling groups on input matches the number returned on output. 4. Given that and, or, and not was removed, there's no purpose for a standalone "input" matcher, particularly since there's now an "inputOutput" matcher.
9713982
to
75058e8
Compare
kstich
requested changes
Nov 6, 2020
smithy-waiters/src/main/java/software/amazon/smithy/waiters/AcceptorState.java
Outdated
Show resolved
Hide resolved
smithy-waiters/src/main/java/software/amazon/smithy/waiters/ModelRuntimeTypeGenerator.java
Outdated
Show resolved
Hide resolved
smithy-waiters/src/main/java/software/amazon/smithy/waiters/ModelRuntimeTypeGenerator.java
Outdated
Show resolved
Hide resolved
smithy-waiters/src/main/java/software/amazon/smithy/waiters/ModelRuntimeTypeGenerator.java
Outdated
Show resolved
Hide resolved
smithy-waiters/src/main/java/software/amazon/smithy/waiters/PathComparator.java
Outdated
Show resolved
Hide resolved
kstich
reviewed
Nov 6, 2020
smithy-waiters/src/main/java/software/amazon/smithy/waiters/PathComparator.java
Outdated
Show resolved
Hide resolved
4bc3ec3
to
06c1b6e
Compare
kstich
approved these changes
Nov 10, 2020
06c1b6e
to
02dfadb
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Waiters are a client-side abstraction used to poll a resource until a desired state is reached, or until it is determined that the resource will never enter into the desired state.
Waiters have been available in AWS SDKs since around 2012, and are now part of Smithy as an additional specification. Note that this PR relies on smithy-jmespath.