Class: RunApi::Core::PollingOptions

Inherits:
Struct
  • Object
show all
Defined in:
lib/runapi/core/types.rb

Overview

Options for polling async task completion. Used internally by resource ‘run` methods.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**kwargs) ⇒ PollingOptions

Returns a new instance of PollingOptions.



94
95
96
97
98
# File 'lib/runapi/core/types.rb', line 94

def initialize(**kwargs)
  super
  self.poll_interval ||= Constants::TIMEOUTS[:polling_interval]
  self.max_wait ||= Constants::TIMEOUTS[:polling_max_wait]
end

Instance Attribute Details

#max_waitInteger

Returns Maximum wait time in seconds. Defaults to 900 (15 minutes).

Returns:

  • (Integer)

    Maximum wait time in seconds. Defaults to 900 (15 minutes).



89
90
91
92
93
94
95
96
97
98
99
# File 'lib/runapi/core/types.rb', line 89

PollingOptions = Struct.new(
  :poll_interval,
  :max_wait,
  keyword_init: true
) do
  def initialize(**kwargs)
    super
    self.poll_interval ||= Constants::TIMEOUTS[:polling_interval]
    self.max_wait ||= Constants::TIMEOUTS[:polling_max_wait]
  end
end

#poll_intervalInteger

Returns Polling interval in seconds. Defaults to 2.

Returns:

  • (Integer)

    Polling interval in seconds. Defaults to 2.



89
90
91
92
93
94
95
96
97
98
99
# File 'lib/runapi/core/types.rb', line 89

PollingOptions = Struct.new(
  :poll_interval,
  :max_wait,
  keyword_init: true
) do
  def initialize(**kwargs)
    super
    self.poll_interval ||= Constants::TIMEOUTS[:polling_interval]
    self.max_wait ||= Constants::TIMEOUTS[:polling_max_wait]
  end
end