lib/smartsheet/api/retry_logic.rb in smartsheet-1.0.0.beta.2 vs lib/smartsheet/api/retry_logic.rb in smartsheet-1.0.0
- old
+ new
@@ -1,8 +1,11 @@
require 'smartsheet/constants'
module Smartsheet
module API
+ # Accepts a callable proc and a predicate, calling the proc repeatedly with backoff until the
+ # provided time limit is reached, or until the predicate applied to the proc's result returns
+ # false.
class RetryLogic
include Smartsheet::Constants
def initialize(max_retry_time: DEFAULT_MAX_RETRY_TIME, backoff_method: DEFAULT_BACKOFF_METHOD)
@max_retry_time = max_retry_time