Interface TaskQueue

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void deleteTask​(Task task)
      Deletes a task from the queue.
      void deleteTasks​(Set<Task> tasks)
      Deletes a set of tasks
      void extendVisibilityTimeout​(Task task)
      Responsible for robustly extending the visibility timeout of a Task.
      String getName()
      A name identifying the queue used for logging and analysis purposes.
      void put​(Set<Task> tasks)
      puts multiple tasks on the queue using batch puts if the queue implementation supports batch puts
      void put​(Task task)
      puts a task on the queue
      void put​(Task... tasks)
      puts multiple tasks on the queue using batch puts if the queue implementation supports batch puts
      void requeue​(Task task)
      Requeues the task by deleting the task, incrementing the "attempts" counter, and re-adding back to the queue.
      Integer size()  
      Integer sizeIncludingInvisibleAndDelayed()  
      Task take()
      Blocks until a task is available
      Set<Task> take​(int maxTasks)
      Take a max of specified number of tasks.
    • Method Detail

      • getName

        String getName()
        A name identifying the queue used for logging and analysis purposes.
        Returns:
      • put

        void put​(Task task)
        puts a task on the queue
        Parameters:
        task -
      • put

        void put​(Task... tasks)
        puts multiple tasks on the queue using batch puts if the queue implementation supports batch puts
        Parameters:
        tasks -
      • put

        void put​(Set<Task> tasks)
        puts multiple tasks on the queue using batch puts if the queue implementation supports batch puts
        Parameters:
        tasks -
      • take

        Set<Task> take​(int maxTasks)
                throws TimeoutException
        Take a max of specified number of tasks. Blocks until at least one task is available.
        Parameters:
        maxTasks - to take from queue. Must be between 1 and 10 inclusive.
        Returns:
        Throws:
        TimeoutException
      • size

        Integer size()
        Returns:
        The approximate number of elements in this queue (does not include invisible and delayed tasks).
      • sizeIncludingInvisibleAndDelayed

        Integer sizeIncludingInvisibleAndDelayed()
        Returns:
        The approximate number of elements in this queue including all items that are visible (available for takes), invisible (in process - not yet completed), and delayed (pending addition to the queue).
      • requeue

        void requeue​(Task task)
        Requeues the task by deleting the task, incrementing the "attempts" counter, and re-adding back to the queue. Any subsequent calls on the requeued task via the task queue should fail due to the task not being found.
        Parameters:
        task -