Interface QueueDao


  • public interface QueueDao
    Database access object to manage tasks in the queue.
    Since:
    06.10.2019
    • Method Detail

      • enqueue

        long enqueue​(@Nonnull
                     QueueLocation location,
                     @Nonnull
                     EnqueueParams<java.lang.String> enqueueParams)
        Add a new task in the queue for processing.
        Parameters:
        location - Queue location.
        enqueueParams - Parameters of the task
        Returns:
        Identifier (sequence id) of new inserted task.
      • deleteTask

        boolean deleteTask​(@Nonnull
                           QueueLocation location,
                           long taskId)
        Remove (delete) task from the queue.
        Parameters:
        location - Queue location.
        taskId - Identifier (sequence id) of the task.
        Returns:
        true, if task was deleted from database, false, when task with given id was not found.
      • reenqueue

        boolean reenqueue​(@Nonnull
                          QueueLocation location,
                          long taskId,
                          @Nonnull
                          java.time.Duration executionDelay)
        Postpone task processing for given time period (current date and time plus execution delay).
        Parameters:
        location - Queue location.
        taskId - Identifier (sequence id) of the task.
        executionDelay - Task execution delay.
        Returns:
        true, if task was successfully postponed, false, when task was not found.