For fixed intervals, an :interval parameter can be passed indicating the time in seconds.
The following example will sleep two seconds between attempts:
retry_upto(5, :interval => 2)
For customized intervals, the :interval parameter can be a lambda, which will be applied
to the number of each attempt. For instance, the following code will sleep 3 seconds after
the first attempt, 6 after the second, 9 after the third...
retry_upto(5, :interval => lambda{ |attempt| attempt * 3 })
Sounds fine, it allows increasing and decreasing series, as well as random ones.
Btw in the example it will sleep 3, 6, 9... (not 2, 6, 9).