Package no.digipost.concurrent
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
interruptedwhiledoWait()is blocking.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWaiter.WasInterrupted
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voiddoWait()Invoking this method will do nothing but block for any duration decided by the instance it is invoked on.static Waiterwait(Duration duration)static Waiterwait(Duration duration, String waiterName)
-
-
-
Method Detail
-
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 isinterruptedwhile the method is blocking.
-
-