Interface TaskSource<R>

Type Parameters:
R - the type of the input used to create or schedule a task

public interface TaskSource<R>
Represents a source of tasks from which tasks can be fetched. When invoked by PollingTaskExecutor, these methods are run within a @UnitOfWork so that any updates they make to the database are visible to the resulting tasks.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the next available input, or an empty Optional if no tasks are available.
    default List<R>
    Returns a list of available inputs to be processed in order.
  • Method Details

    • nextInput

      Optional<R> nextInput()
      Returns the next available input, or an empty Optional if no tasks are available.
      Returns:
      an Optional containing the next input, or empty if none is available
    • nextInputs

      default List<R> nextInputs()
      Returns a list of available inputs to be processed in order. Defaults to a singleton list from nextInput(), or an empty list if none is available. Implementations may override this method to return multiple inputs at once.
      Returns:
      a list of inputs to process, possibly empty