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

make it easy to add custom waiters #1047

Closed
danp opened this issue Jan 6, 2016 · 5 comments
Closed

make it easy to add custom waiters #1047

danp opened this issue Jan 6, 2016 · 5 comments
Labels
feature-request A feature should be added or improved. needs-major-version Can only be considered for the next major release

Comments

@danp
Copy link
Contributor

danp commented Jan 6, 2016

Until #1039 is merged I'm implementing the waiter myself, like this:

poller = Aws::Waiters::Poller.new(
  "operation" => "DescribeNatGateways",
  "acceptors" => [
    { "expected" => "available", "matcher" => "pathAll", "state" => "success", "argument" => "NatGateways[].State" },
    { "expected" => "InvalidNatGatewayIDNotFound", "matcher" => "error", "state" => "retry" },
    { "expected" => "failed", "matcher" => "pathAny", "state" => "failure", "argument" => "NatGateways[].State" },
    { "expected" => "deleting", "matcher" => "pathAny", "state" => "failure", "argument" => "NatGateways[].State" },
    { "expected" => "deleted", "matcher" => "pathAny", "state" => "failure", "argument" => "NatGateways[].State" },
  ],
)
waiter = Aws::Waiters::Waiter.new(poller: poller, max_attempts: 40, delay: 15)
waiter.wait(client: ec2, params: { nat_gateway_ids: [nat_gateway_id] })

As best I can tell there is no public way to inject custom waiters. It would be nice if I could add to the default set on a per-client or per-service basis, so I could use something like ec2.wait_until(:nat_gateway_available, ...) regardless of where the waiter is defined.

@awood45
Copy link
Member

awood45 commented Jan 6, 2016

This is an interesting feature request, will definitely take a look at this.

@awood45 awood45 added feature-request A feature should be added or improved. Version 2 labels Jan 6, 2016
@basex
Copy link

basex commented Jan 27, 2016

is there a way to have a waiters for Aws::Route53::Client?

The waiter_names list is empty on the documentation: http://docs.aws.amazon.com/sdkforruby/api/Aws/Route53/Client.html#waiter_names-instance_method

awood45 added a commit that referenced this issue Feb 3, 2016
Adds feature requests related to issues #1047 and #1051.
@awood45
Copy link
Member

awood45 commented Feb 3, 2016

Adding to feature request backlog. Will also take a PR for this if you want to take a crack at it.

@awood45 awood45 closed this as completed Feb 3, 2016
@awood45
Copy link
Member

awood45 commented Feb 3, 2016

@basex A lack of waiters just means that none have been created yet, and that there is no waiters JSON file. We can still take PRs, for example, to add Route53 waiters. You'd just need to create the file in the pattern of other waiter files.

awood45 added a commit that referenced this issue Feb 9, 2016
@mullermp
Copy link
Contributor

Reopening - deprecating usage of Feature Requests backlog markdown file.

@mullermp mullermp reopened this Oct 21, 2019
@mullermp mullermp added waiter and removed v2 labels Oct 21, 2019
@mullermp mullermp reopened this May 26, 2020
@mullermp mullermp added the needs-major-version Can only be considered for the next major release label Jul 9, 2020
@mullermp mullermp closed this as completed Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. needs-major-version Can only be considered for the next major release
Projects
None yet
Development

No branches or pull requests

4 participants