All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bazaarvoice.ostrich.RetryPolicy Maven / Gradle / Ivy

There is a newer version: 2.1.0
Show newest version
package com.bazaarvoice.ostrich;

/** Abstracts the strategy of determining when to retry operations. */
public interface RetryPolicy {
    /**
     * Called when an operation has failed for some reason.  If this method returns true
     * then the operation will be retried.
     *
     * @param numAttempts   The number of attempts that have happened so far.  This must be greater than zero.
     * @param elapsedTimeMs The amount of time in milliseconds that the operation has been attempted.
     * @return true if the operation can be tried again, false otherwise.
     */
    boolean allowRetry(int numAttempts, long elapsedTimeMs);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy