Class ScheduleOnce2

java.lang.Object
org.aksw.commons.util.concurrent.ScheduleOnce2

public class ScheduleOnce2 extends Object
Class to schedule a task after a certain delay and ensure that it only executes once. If there is a request to schedule the task while it is already running it will be scheduled for the delay.
Author:
raven
  • Field Details

    • executor

      protected Consumer<Callable<?>> executor
    • task

      protected Callable<?> task
    • lastRequestTime

      protected volatile long lastRequestTime
    • lastTaskStartTime

      protected volatile Long lastTaskStartTime
    • lock

      protected final Object lock
  • Constructor Details

  • Method Details

    • scheduleTask

      public void scheduleTask()