Module: Aws::ClientWaiters
- Included in:
- Client
- Defined in:
- lib/aws-sdk-core/client_waiters.rb
Class Method Summary collapse
- .included(subclass) ⇒ Object private
Instance Method Summary collapse
-
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Seahorse::Client::Response
Waits until a particular condition is satisfied.
-
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters.
Class Method Details
.included(subclass) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/aws-sdk-core/client_waiters.rb', line 5 def self.included(subclass) class << subclass def set_waiters(waiters) @waiters = case waiters when Waiters::Provider then waiters when Hash then Waiters::Provider.new(waiters) when String, Pathname then Waiters::Provider.new(Aws.load_json(waiters)) when nil then Waiters::NullProvider.new else raise ArgumentError, 'invalid waiters' end end def waiters @waiters end end end |
Instance Method Details
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Seahorse::Client::Response
Waits until a particular condition is satisfied. This works by polling a client request and checking for particular response data or errors. Waiters each have a default duration max attempts which are configurable. Additionally, you can register callbacks and stop waiters by throwing ‘:success` or `:failure`.
92 93 94 95 96 |
# File 'lib/aws-sdk-core/client_waiters.rb', line 92 def wait_until(waiter_name, params = {}, &block) waiter = self.class.waiters.waiter(waiter_name) yield(waiter) if block_given? waiter.wait(self, params) end |
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters.
100 101 102 |
# File 'lib/aws-sdk-core/client_waiters.rb', line 100 def waiter_names self.class.waiters.waiter_names end |