Package com.mchange.v2.async
Class ThreadPerTaskAsynchronousRunner
java.lang.Object
com.mchange.v2.async.ThreadPerTaskAsynchronousRunner
- All Implemented Interfaces:
ClosableResource
,AsynchronousRunner
-
Constructor Summary
ConstructorDescriptionThreadPerTaskAsynchronousRunner
(int max_task_threads) ThreadPerTaskAsynchronousRunner
(int max_task_threads, long interrupt_task_delay) -
Method Summary
-
Constructor Details
-
ThreadPerTaskAsynchronousRunner
public ThreadPerTaskAsynchronousRunner(int max_task_threads) -
ThreadPerTaskAsynchronousRunner
public ThreadPerTaskAsynchronousRunner(int max_task_threads, long interrupt_task_delay)
-
-
Method Details
-
postRunnable
- Specified by:
postRunnable
in interfaceAsynchronousRunner
-
close
public void close()Description copied from interface:AsynchronousRunner
Clean-up resources held by this asynchronous runner as soon as possible. Remaining tasks are skipped if possible, and any tasks executing when close() is called may or may not be interrupted. Equivalent to close( true ).- Specified by:
close
in interfaceAsynchronousRunner
- Specified by:
close
in interfaceClosableResource
-
close
public void close(boolean skip_remaining_tasks) Description copied from interface:AsynchronousRunner
Finish with this AsynchronousRunner, and clean-up any Threads or resources it may hold.- Specified by:
close
in interfaceAsynchronousRunner
- Parameters:
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.
-
getRunningCount
public int getRunningCount() -
getRunningTasks
-
getWaitingCount
public int getWaitingCount() -
getWaitingTasks
-
isClosed
public boolean isClosed() -
isDoneAndGone
public boolean isDoneAndGone()
-