Constructor and Description |
---|
SynchronousExecutors(java.util.concurrent.ScheduledExecutorService pool) |
Modifier and Type | Method and Description |
---|---|
<T> java.util.concurrent.ExecutorService |
newSerialExecutor(java.util.concurrent.BlockingQueue<java.util.concurrent.Callable<T>> queue)
The ExecutorService returned, supports a subset of ExecutorService
methods, the intent of this executor is to serialize the execution
of tasks, it is up to the BlockingQueue or caller to ensure order, only
one task will execute at a time, that task will be retried if it fails,
using a back off strategy of 1, 5 and 10 seconds, followed by 1, 1 and 5
minutes thereafter forever, no other task will execute until the task
at the head of the queue is completed successfully.
|
void |
shutdown() |
void |
start()
Called after construction, this method enables objects to delay
starting threads or exporting until after construction is complete,
to allow safe publication of the service in accordance with the JMM.
|
public SynchronousExecutors(java.util.concurrent.ScheduledExecutorService pool)
public void start() throws Exception
Startable
In addition to starting threads after construction, it also allows objects to avoid throwing an exception during construction to avoid finalizer attacks.
The implementation is required to ensure start() is idempotent (only executed once, additional invocations must return immediately).
public void shutdown()
public <T> java.util.concurrent.ExecutorService newSerialExecutor(java.util.concurrent.BlockingQueue<java.util.concurrent.Callable<T>> queue)
T
- queue
- Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.