| In: |
lib/rq-2.3.1/sleepcycle.rb
|
| Parent: | Array |
the sleepcycle class provides timeouts for better than average polling performance by the locking protocol used by the QDB
| inc | [R] | |
| max | [R] | |
| min | [R] | |
| range | [R] |
# File lib/rq-2.3.1/sleepcycle.rb, line 17
17: def initialize min, max, inc
18: #--{{{
19: @min, @max, @inc = Float(min), Float(max), Float(inc)
20: @range = @max - @min
21: raise RangeError, "max < min" if @max < @min
22: raise RangeError, "inc > range" if @inc > @range
23: s = @min
24: push(s) and s += @inc while(s <= @max)
25: self[-1] = @max if self[-1] < @max
26: reset
27: #--}}}
28: end