Class DefaultWorkQueue<T>
java.lang.Object
io.kubernetes.client.extended.workqueue.DefaultWorkQueue<T>
- All Implemented Interfaces:
WorkQueue<T>
- Direct Known Subclasses:
DefaultDelayingQueue
The default
WorkQueue implementation that uses a doubly-linked list to store work items.
This class ensures the added work items are, not in dirty set or currently processing set, before
append them to the list.
Usage example, based on a typical producer-consumer scenario.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd marks item as needing processing.voidDone 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.booleanreturns whether the queue shutdown.intlength()length returns the current queue length, for informational purposes only.voidshutDown()ShutDown will cause q to ignore all new items added to it.
-
Constructor Details
-
DefaultWorkQueue
public DefaultWorkQueue()
-
-
Method Details
-
add
Description copied from interface:WorkQueueadd marks item as needing processing. -
length
public int length()Description copied from interface:WorkQueuelength returns the current queue length, for informational purposes only. -
get
Description copied from interface:WorkQueueGet blocks until it can return an item to be processed. If shutdown = true, the caller should end their process.- Specified by:
getin interfaceWorkQueue<T>- Returns:
- the object
- Throws:
InterruptedException
-
done
Description copied from interface:WorkQueueDone marks item as done processing, and if it has been marked as dirty again, -
shutDown
public void shutDown()Description copied from interface:WorkQueueShutDown will cause q to ignore all new items added to it. -
isShuttingDown
public boolean isShuttingDown()Description copied from interface:WorkQueuereturns whether the queue shutdown.- Specified by:
isShuttingDownin interfaceWorkQueue<T>- Returns:
- returns
trueif the
-