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...