Class Waiter

java.lang.Object
no.digipost.concurrent.Waiter

public abstract class Waiter extends Object
Instances of this class has no other purpose than to hold execution. The use case is typically to implement a periodically running process.

It will throw Waiter.WasInterrupted if the current thread is interrupted while doWait() is blocking.

  • Method Details

    • doWait

      public abstract void doWait()
      Invoking this method will do nothing but block for any duration decided by the instance it is invoked on.
      Throws:
      Waiter.WasInterrupted - if the current thread is interrupted while the method is blocking.
    • wait

      public static Waiter wait(Duration duration)
    • wait

      public static Waiter wait(Duration duration, String waiterName)