Class: RunApi::Core::PollingOptions
- Inherits:
-
Struct
- Object
- Struct
- RunApi::Core::PollingOptions
- Defined in:
- lib/runapi/core/types.rb
Overview
Options for polling async task completion. Used internally by resource ‘run` methods.
Instance Attribute Summary collapse
-
#max_wait ⇒ Integer
Maximum wait time in seconds.
-
#poll_interval ⇒ Integer
Polling interval in seconds.
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ PollingOptions
constructor
A new instance of PollingOptions.
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_wait ⇒ Integer
Returns 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_interval ⇒ Integer
Returns 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 |