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 TypeMethodDescriptionvoid
add marks item as needing processing.void
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()
length returns the current queue length, for informational purposes only.void
shutDown()
ShutDown will cause q to ignore all new items added to it.
-
Method Details
-
add
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
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
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
-