public class JIPipeRunnerQueue extends Object
JIPipeRunnable
Modifier and Type | Method and Description |
---|---|
void |
cancel(JIPipeRunnable run)
Cancels a runnable
|
void |
clearQueue()
Removes all enqueued (but not running tasks)
|
JIPipeRunWorker |
enqueue(JIPipeRunnable run)
Schedules a new runnable
|
JIPipeRunWorker |
findWorkerOf(JIPipeRunnable run)
Finds the worker associated to the
JIPipeRunnable |
JIPipeRunnable |
getCurrentRun() |
JIPipeRunWorker |
getCurrentRunWorker() |
EventBus |
getEventBus() |
static JIPipeRunnerQueue |
getInstance() |
Queue<JIPipeRunWorker> |
getQueue() |
boolean |
isEmpty() |
boolean |
isRunningOrEnqueued(JIPipeRunnable runnable)
Determines if a runnable is enqueued or running
|
void |
onWorkerFinished(RunWorkerFinishedEvent event)
Triggered when a worker is finished
|
void |
onWorkerInterrupted(RunWorkerInterruptedEvent event)
Triggered when a worker is interrupted
|
void |
onWorkerProgress(RunWorkerProgressEvent event)
Triggered when a worker reports progress
|
int |
size()
The size of the queue (includes the currently running
JIPipeProjectRun |
void |
tryDequeue()
Attempts to run a scheduled run
|
public static JIPipeRunnerQueue getInstance()
public boolean isRunningOrEnqueued(JIPipeRunnable runnable)
runnable
- the runnablepublic Queue<JIPipeRunWorker> getQueue()
public boolean isEmpty()
public int size()
JIPipeProjectRun
public JIPipeRunWorker enqueue(JIPipeRunnable run)
run
- The runnablepublic JIPipeRunWorker findWorkerOf(JIPipeRunnable run)
JIPipeRunnable
run
- The runnablepublic void tryDequeue()
public void cancel(JIPipeRunnable run)
run
- The runnablepublic void onWorkerFinished(RunWorkerFinishedEvent event)
event
- Generated eventpublic void onWorkerInterrupted(RunWorkerInterruptedEvent event)
event
- Generated eventpublic void onWorkerProgress(RunWorkerProgressEvent event)
event
- Generated eventpublic EventBus getEventBus()
public JIPipeRunWorker getCurrentRunWorker()
public JIPipeRunnable getCurrentRun()
public void clearQueue()
Copyright © 2020–2022 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.