public interface ConcurrentProcessor extends chemaxon.util.concurrent.util.ConcurrentIterator, Cancelable
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Calls
cleanup(long) with Long.MAX_VALUE . |
void |
cleanup(long joinTimeout)
Cancels work currently executed under the control of this
ConcurrentProcessor instance, awaits termination of associated
worker threads and releases any resource this processor has reserved. |
void |
setMaxOutputQueueSize(int size)
Sets the maximum size of the output queue.
|
void |
setWorkerThreadCount(int workerThreadCount)
Sets the number of worker threads used by this processor.
|
void |
start()
Starts concurrently processing inputs returned by the
InputProducer instance using WorkUnit instances returned
by the WorkUnitFactory instance. |
cancel, isCanceled
void setMaxOutputQueueSize(int size)
start()
is called. The default output queue size is: CPU core
count * 100.size
- the maximum size of the output queue.void start() throws ExecutionException
InputProducer
instance using WorkUnit
instances returned
by the WorkUnitFactory
instance.ExecutionException
void cleanup(long joinTimeout) throws InterruptedException, ExecutionException, TimeoutException
ConcurrentProcessor
instance, awaits termination of associated
worker threads and releases any resource this processor has reserved.joinTimeout
- specifies in milliseconds at most how long this method is
allowed to await the termination of each the worker threads.
'0' means don't wait at all. This parameter is relevant when
the worker threads have been cancelled as a result of the
processor having been cancelled either explicitly by the user
or internally reacting on an execution error.InterruptedException
- if the current thread has been interrupted.ExecutionException
- if any of the worker threads encountered an error during
execution.TimeoutException
void cleanup() throws InterruptedException, ExecutionException, TimeoutException
cleanup(long)
with Long.MAX_VALUE
.void setWorkerThreadCount(int workerThreadCount)
WorkUnit
s being processed using
WorkUnitManager.getConcurrencyDegree(java.util.concurrent.Callable)
.