Class SimpleRetryStrategy
- java.lang.Object
-
- io.github.shsmysore.fcmjava.client.retry.strategy.SimpleRetryStrategy
-
- All Implemented Interfaces:
IRetryStrategy
public class SimpleRetryStrategy extends Object implements IRetryStrategy
The SimpleRetryStrategy retries all methods, that throw a @seeFcmRetryAfterExceptionfor a maximum number of retries. The @seeFcmRetryAfterExceptionincludes a Retry Delay, which indicates when the method should be retried. This Strategy waits for the amount of time given in the @seeFcmRetryAfterExceptionand waits for a fixed amount of time.
-
-
Constructor Summary
Constructors Constructor Description SimpleRetryStrategy(int maxRetries)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoWithRetry(Action0 action)Retries a function without a return value.<TResult> TResultgetWithRetry(Func1<TResult> function)Retries a function with a return values.
-
-
-
Method Detail
-
doWithRetry
public void doWithRetry(Action0 action)
Description copied from interface:IRetryStrategyRetries a function without a return value.- Specified by:
doWithRetryin interfaceIRetryStrategy- Parameters:
action- Action to invoke.
-
getWithRetry
public <TResult> TResult getWithRetry(Func1<TResult> function)
Description copied from interface:IRetryStrategyRetries a function with a return values.- Specified by:
getWithRetryin interfaceIRetryStrategy- Type Parameters:
TResult- Result of the invocation.- Parameters:
function- Function to invoke.- Returns:
- Result of the invocation.
-
-