Package org.tinyradius.client.retry
Interface RetryStrategy
-
- All Known Implementing Classes:
SimpleRetryStrategy
public interface RetryStrategy
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
scheduleRetry(java.lang.Runnable retry, int totalAttempts, io.netty.util.concurrent.Promise<RadiusPacket> promise)
Schedule a retry in the future.
-
-
-
Method Detail
-
scheduleRetry
void scheduleRetry(java.lang.Runnable retry, int totalAttempts, io.netty.util.concurrent.Promise<RadiusPacket> promise)
Schedule a retry in the future. Invoked immediately after a request is sent to schedule next retry.When retry is due to run, should also check if promise isDone() before running.
Implemented here instead of RadiusClient so custom scheduling / retry backoff can be used depending on implementation, and actual retry can be deferred. Scheduling and logic should be implemented here, while RadiusClient only deals with IO.
- Parameters:
retry
- runnable to invoke to retrytotalAttempts
- current attempt countpromise
- request promise that resolves when a response is received
-
-