public Retryer < R > incrementingWait ( final long initialSleepTime , final long increment ) { checkArgument ( initialSleepTime >= 0L , "initialSleepTime must be >= 0 but is %d" , initialSleepTime ) ; return withWaitStrategy ( new WaitStrategy ( ) { @ Override public long computeSleepTime ( int previousAttemptNumber , long delaySinceFirstAttemptInMillis ) { long result = initialSleepTime + ( increment * ( previousAttemptNumber - 1 ) ) ; return result >= 0L ? result : 0L ; } } ) ; }
Sets the strategy that sleeps a fixed amount milliseconds after the first failed attempt and in incrementing amounts milliseconds after each additional failed attempt .