Class: Take2::Backoff

Inherits:
Object
  • Object
show all
Defined in:
lib/take2/backoff.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, start = 1, factor = 1, retries = 10) ⇒ Backoff

Returns a new instance of Backoff.



7
8
9
10
11
12
13
# File 'lib/take2/backoff.rb', line 7

def initialize(type, start = 1, factor = 1, retries = 10)
  @type = type
  @start = start.to_i
  @retries = retries
  @factor = factor
  @intervals = intervals_table
end

Instance Attribute Details

#factorObject (readonly)

Returns the value of attribute factor.



5
6
7
# File 'lib/take2/backoff.rb', line 5

def factor
  @factor
end

#intervalsObject (readonly)

Returns the value of attribute intervals.



5
6
7
# File 'lib/take2/backoff.rb', line 5

def intervals
  @intervals
end

#retriesObject (readonly)

Returns the value of attribute retries.



5
6
7
# File 'lib/take2/backoff.rb', line 5

def retries
  @retries
end

#startObject (readonly)

Returns the value of attribute start.



5
6
7
# File 'lib/take2/backoff.rb', line 5

def start
  @start
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/take2/backoff.rb', line 5

def type
  @type
end