Interface WaitStrategy


public interface WaitStrategy
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    idle(int idleCounter)
    This method can implement static or dynamic backoff.
  • Method Details

    • idle

      int idle(int idleCounter)
      This method can implement static or dynamic backoff. Dynamic backoff will rely on the counter for estimating how long the caller has been idling. The expected usage is:
       
       int ic = 0;
       while(true) {
         if(!isGodotArrived()) {
           ic = w.idle(ic);
           continue;
         }
         ic = 0;
         // party with Godot until he goes again
       }
       
       
      Parameters:
      idleCounter - idle calls counter, managed by the idle method until reset
      Returns:
      new counter value to be used on subsequent idle cycle