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

ru.dezhik.sms.sender.RetryPolicy Maven / Gradle / Ivy

There is a newer version: 0.1.3
Show newest version
package ru.dezhik.sms.sender;

import ru.dezhik.sms.sender.api.ApiRequest;
import ru.dezhik.sms.sender.api.ApiResponse;

/**
 * @author ilya.dezhin
 */
public interface RetryPolicy {
    /**
     *
     * @param request request instance to the remote API
     * @param response response from the remote API, could be null.
     * @return true if retry must be done otherwise false
     */
    boolean shouldRetry(Req request, Resp response);

    /**
     * @return delay duration in ms before next retry
     */
    long getDelayDurationMs();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy