public class CarefulRunnableQueue extends java.lang.Object implements RunnableQueue, Queuable, StrandedTaskReporting
Constructor and Description |
---|
CarefulRunnableQueue(boolean daemon,
boolean shutdown_on_interrupt) |
Modifier and Type | Method and Description |
---|---|
RunnableQueue |
asRunnableQueue() |
void |
close()
Clean-up resources held by this asynchronous runner
as soon as possible.
|
void |
close(boolean skip_remaining_tasks)
Finish with this AsynchronousRunner, and clean-up
any Threads or resources it may hold.
|
java.util.List |
getStrandedTasks()
makes available any tasks that were unperformed when
this AsynchronousRunner was closed, either explicitly
using close() or close( true ), or implicitly because
some failure or corruption killed the Object (most likely
a Thread interruption.
|
void |
postRunnable(java.lang.Runnable r) |
public CarefulRunnableQueue(boolean daemon, boolean shutdown_on_interrupt)
public RunnableQueue asRunnableQueue()
asRunnableQueue
in interface Queuable
public void postRunnable(java.lang.Runnable r)
postRunnable
in interface AsynchronousRunner
public void close(boolean skip_remaining_tasks)
AsynchronousRunner
close
in interface AsynchronousRunner
skip_remaining_tasks
- Should be regarded as
a hint, not a guarantee. If true, pending,
not-yet-performed tasks will be skipped,
if possible.
Currently executing tasks may or
may not be interrupted. If false, all
previously scheduled tasks will be
completed prior to clean-up. The method
returns immediately regardless.public void close()
AsynchronousRunner
close
in interface ClosableResource
close
in interface AsynchronousRunner
public java.util.List getStrandedTasks()
StrandedTaskReporting
getStrandedTasks
in interface StrandedTaskReporting