Class PollingTaskExecutor<R>

java.lang.Object
nl.knaw.dans.lib.util.pollingtaskexec.PollingTaskExecutor<R>
Type Parameters:
R - the type of the task records returned by the task source
All Implemented Interfaces:
io.dropwizard.lifecycle.Managed

public class PollingTaskExecutor<R> extends Object implements io.dropwizard.lifecycle.Managed
A task executor that repeatedly polls a task source for new work items at a fixed interval and executes them using a provided task factory. This class is designed to manage the lifecycle of a polling process that retrieves tasks and executes them in a controlled manner.
  • Constructor Details

    • PollingTaskExecutor

      public PollingTaskExecutor(PollingTaskExecutor<R> other)
      Copy constructor. The source executor must not be running. The purpose of this constructor is only to be able to wrap a PollingTaskExecutor in a UnitOfWorkAwareProxy. In general, no copies should be created of a PollingTaskExecutor, and in particular should the schedular not be shared among PollingTaskExecutors.
      Parameters:
      other - the source executor
  • Method Details

    • start

      public void start()
      Specified by:
      start in interface io.dropwizard.lifecycle.Managed
    • stop

      public void stop()
      Specified by:
      stop in interface io.dropwizard.lifecycle.Managed
    • tick

      @UnitOfWork public void tick()