Interface MessagePassingQueue.WaitStrategy

  • Enclosing interface:
    MessagePassingQueue<T>

    public static interface MessagePassingQueue.WaitStrategy
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int idle​(int idleCounter)
      This method can implement static or dynamic backoff.
    • Method Detail

      • 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