Package com.mchange.v2.async
Class RoundRobinAsynchronousRunner
java.lang.Object
com.mchange.v2.async.RoundRobinAsynchronousRunner
- All Implemented Interfaces:
ClosableResource,AsynchronousRunner,Queuable
A class that provides for effecient asynchronous execution
of multiple tasks that may block, but that do not contend
for the same locks. The order in which tasks will be executed
is not guaranteed.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
RoundRobinAsynchronousRunner
public RoundRobinAsynchronousRunner(int num_threads, boolean daemon)
-
-
Method Details
-
postRunnable
- Specified by:
postRunnablein interfaceAsynchronousRunner
-
asRunnableQueue
- Specified by:
asRunnableQueuein interfaceQueuable
-
close
public void close(boolean skip_remaining_tasks) Description copied from interface:AsynchronousRunnerFinish with this AsynchronousRunner, and clean-up any Threads or resources it may hold.- Specified by:
closein 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.
-
close
public void close()Description copied from interface:AsynchronousRunnerClean-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:
closein interfaceAsynchronousRunner- Specified by:
closein interfaceClosableResource
-