Package org.apache.camel.util.concurrent
Class AsyncCompletionService<V>
- java.lang.Object
-
- org.apache.camel.util.concurrent.AsyncCompletionService<V>
-
public class AsyncCompletionService<V> extends Object
A completion service that orders the completed tasks in the same order as they where submitted.
-
-
Constructor Summary
Constructors Constructor Description AsyncCompletionService(Executor executor, boolean ordered)
AsyncCompletionService(Executor executor, boolean ordered, ReentrantLock lock)
AsyncCompletionService(Executor executor, boolean ordered, ReentrantLock lock, int capacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReentrantLock
getLock()
V
poll()
V
poll(long timeout, TimeUnit unit)
V
pollUnordered()
void
skip()
void
submit(Consumer<Consumer<V>> runner)
V
take()
-
-
-
Constructor Detail
-
AsyncCompletionService
public AsyncCompletionService(Executor executor, boolean ordered)
-
AsyncCompletionService
public AsyncCompletionService(Executor executor, boolean ordered, ReentrantLock lock)
-
AsyncCompletionService
public AsyncCompletionService(Executor executor, boolean ordered, ReentrantLock lock, int capacity)
-
-
Method Detail
-
getLock
public ReentrantLock getLock()
-
skip
public void skip()
-
pollUnordered
public V pollUnordered()
-
poll
public V poll(long timeout, TimeUnit unit) throws InterruptedException
- Throws:
InterruptedException
-
take
public V take() throws InterruptedException
- Throws:
InterruptedException
-
-