Package org.cip4.jdflib.util.thread
Class MultiJobTaskQueue
java.lang.Object
java.lang.Thread
org.cip4.jdflib.util.thread.OrderedTaskQueue
org.cip4.jdflib.util.thread.MultiTaskQueue
org.cip4.jdflib.util.thread.MultiJobTaskQueue
- All Implemented Interfaces:
Runnable
class to run multiple tasks in parallel while ensuring that all tasks that belong to one job remain in order
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Method Summary
Modifier and TypeMethodDescriptionstatic MultiJobTaskQueuegetCreateJobQueue(String name, int maxParallel) grab the queuebooleanisUnique()booleanensure we don't accidentally queue non-runpairsbooleanvoidsetUnique(boolean unique) toString()Methods inherited from class org.cip4.jdflib.util.thread.MultiTaskQueue
executing, getCreateQueue, getCurrentRunning, getMaxParallel, getPercentQueue, interruptCurrent, interruptTask, setMaxParallel, setPercentQueue, shutDown, startMethods inherited from class org.cip4.jdflib.util.thread.OrderedTaskQueue
getAvQueue, getAvRun, getCreateQueue, getDone, getSumQueue, getSumRun, isLive, run, shortString, shutDown, shutDownAll, size, waitingMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, suspend, yield
-
Method Details
-
isUnique
public boolean isUnique()- Returns:
- the unique
-
setUnique
public void setUnique(boolean unique) - Parameters:
unique- the unique to set
-
getCreateJobQueue
grab the queue- Parameters:
name- - must not be nullmaxParallel- ignored if <=0- Returns:
- the queue to fill with tasks
-
queue
- Parameters:
task-mutex- all tasks wit the same mutex will be run in sequence- Returns:
-
queue
ensure we don't accidentally queue non-runpairs- Overrides:
queuein classOrderedTaskQueue- Parameters:
task- the thing to send off- Returns:
- true if successfully queued
- See Also:
-
toString
- Overrides:
toStringin classMultiTaskQueue- See Also:
-