Package org.jctools.queues
Interface MessagePassingQueue.WaitStrategy
- Enclosing interface:
MessagePassingQueue<T>
public static interface MessagePassingQueue.WaitStrategy
-
Method Summary
Modifier and TypeMethodDescriptionint
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
-