Class ReRunThrottler

java.lang.Object
org.zeroturnaround.javarebel.integration.util.ReRunThrottler

public class ReRunThrottler extends Object
Utility for throttling method runs for at least checkInterval Example usage:
 private final ReRunThrottler throttler = new ReRunThrottler(ConfigurationFactory.getInstance().getCheckInterval());
 ...
 public void someMethod() {
   if (throttler.shouldThrottle()) return;
   // do stuff
 }
 
  • Field Details

    • checkInterval

      public final int checkInterval
  • Constructor Details

    • ReRunThrottler

      public ReRunThrottler()
    • ReRunThrottler

      public ReRunThrottler(int checkInterval)
  • Method Details

    • shouldThrottle

      public boolean shouldThrottle()