Interface WorkQueue<T>

All Known Subinterfaces:
DelayingQueue<T>, RateLimitingQueue<T>
All Known Implementing Classes:
DefaultDelayingQueue, DefaultRateLimitingQueue, DefaultWorkQueue

public interface WorkQueue<T>
The workqueue interface defines the queue behavior.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(T item)
    add marks item as needing processing.
    void
    done(T item)
    Done marks item as done processing, and if it has been marked as dirty again,
    get()
    Get blocks until it can return an item to be processed.
    boolean
    returns whether the queue shutdown.
    int
    length returns the current queue length, for informational purposes only.
    void
    ShutDown will cause q to ignore all new items added to it.
  • Method Details

    • add

      void add(T item)
      add marks item as needing processing.
      Parameters:
      item - item to add
    • length

      int length()
      length returns the current queue length, for informational purposes only.
      Returns:
      current queue length
    • get

      T get() throws InterruptedException
      Get blocks until it can return an item to be processed. If shutdown = true, the caller should end their process.
      Returns:
      the object
      Throws:
      InterruptedException
    • done

      void done(T item)
      Done marks item as done processing, and if it has been marked as dirty again,
      Parameters:
      item - specific item
    • shutDown

      void shutDown()
      ShutDown will cause q to ignore all new items added to it.
    • isShuttingDown

      boolean isShuttingDown()
      returns whether the queue shutdown.
      Returns:
      returns true if the