class Aws::DynamoDB::Table

def wait_until(options = {}, &block)

Returns:
  • (Resource) - if the waiter was successful

Options Hash: (**options)
  • :before_wait (Proc) -- Callback
  • :before_attempt (Proc) -- Callback
  • :delay (Integer) -- Delay between each
  • :max_attempts (Integer) -- Maximum number of

Raises:
  • (NotImplementedError) - Raised when the resource does not
  • (Aws::Waiters::Errors::UnexpectedError) - Raised when an error is encountered
  • (Aws::Waiters::Errors::FailureStateError) - Raised when the waiter terminates

Other tags:
    Note: - The waiting operation is performed on a copy. The original resource remains unchanged

Deprecated:
  • Use [Aws::DynamoDB::Client] #wait_until instead
def wait_until(options = {}, &block)
  self_copy = self.dup
  attempts = 0
  options[:max_attempts] = 10 unless options.key?(:max_attempts)
  options[:delay] ||= 10
  options[:poller] = Proc.new do
    attempts += 1
    if block.call(self_copy)
      [:success, self_copy]
    else
      self_copy.reload unless attempts == options[:max_attempts]
      :retry
    end
  end
  Aws::Waiters::Waiter.new(options).wait({})
end