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 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.
-
Constructor Details
-
DefaultWorkQueue
public DefaultWorkQueue()
-
-
Method Details
-
add
Description copied from interface:WorkQueue
add marks item as needing processing. -
length
public int length()Description copied from interface:WorkQueue
length returns the current queue length, for informational purposes only. -
get
Description copied from interface:WorkQueue
Get blocks until it can return an item to be processed. If shutdown = true, the caller should end their process.- Specified by:
get
in interfaceWorkQueue<T>
- Returns:
- the object
- Throws:
InterruptedException
-
done
Description copied from interface:WorkQueue
Done marks item as done processing, and if it has been marked as dirty again, -
shutDown
public void shutDown()Description copied from interface:WorkQueue
ShutDown will cause q to ignore all new items added to it. -
isShuttingDown
public boolean isShuttingDown()Description copied from interface:WorkQueue
returns whether the queue shutdown.- Specified by:
isShuttingDown
in interfaceWorkQueue<T>
- Returns:
- returns
true
if the
-