public class JobLauncherImpl extends JobLauncher
Constructor and Description |
---|
JobLauncherImpl() |
Modifier and Type | Method and Description |
---|---|
<T> boolean |
invokeConcurrentlyUnderProgress(java.util.List<? extends T> things,
ProgressIndicator progress,
boolean runInReadAction,
boolean failFastOnAcquireReadAction,
Processor<? super T> thingProcessor) |
<T> boolean |
processQueue(java.util.concurrent.BlockingQueue<T> things,
java.util.Queue<T> failedToProcess,
ProgressIndicator progress,
T tombStone,
Processor<? super T> thingProcessor)
Process all elements from the
failedToProcess and then things concurrently in the underlying pool. |
Job<java.lang.Void> |
submitToJobThread(java.lang.Runnable action,
Consumer<? super java.util.concurrent.Future<?>> onDoneCallback)
NEVER EVER submit runnable which can lock itself for indeterminate amount of time.
|
getInstance, invokeConcurrentlyUnderProgress, invokeConcurrentlyUnderProgress
public <T> boolean invokeConcurrentlyUnderProgress(java.util.List<? extends T> things, ProgressIndicator progress, boolean runInReadAction, boolean failFastOnAcquireReadAction, Processor<? super T> thingProcessor) throws ProcessCanceledException
invokeConcurrentlyUnderProgress
in class JobLauncher
ProcessCanceledException
public Job<java.lang.Void> submitToJobThread(java.lang.Runnable action, Consumer<? super java.util.concurrent.Future<?>> onDoneCallback)
JobLauncher
Application.executeOnPooledThread(Runnable)
insteadsubmitToJobThread
in class JobLauncher
public <T> boolean processQueue(java.util.concurrent.BlockingQueue<T> things, java.util.Queue<T> failedToProcess, ProgressIndicator progress, T tombStone, Processor<? super T> thingProcessor)
failedToProcess
and then things
concurrently in the underlying pool.
Processing happens concurrently maintaining JobSchedulerImpl.CORES_COUNT
parallelism.
Stop when tombStone
element is occurred.
If was unable to process some element, add it back to the failedToProcess
queue.