Interface TimeoutHandler

All Known Implementing Classes:
FixedTimeoutHandler

public interface TimeoutHandler
Schedules a retry in the future and handles timeouts.

Invoked after every request is sent to schedule a retry or timeout check in the future.

  • Method Summary

    Modifier and Type Method Description
    void onTimeout​(java.lang.Runnable retry, int totalAttempts, io.netty.util.concurrent.Promise<RadiusResponse> promise)
    Schedule a retry in the future.
  • Method Details

    • onTimeout

      void onTimeout​(java.lang.Runnable retry, int totalAttempts, io.netty.util.concurrent.Promise<RadiusResponse> 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 retry
      totalAttempts - current attempt count
      promise - request promise that resolves when a response is received