public class CountingCompletionService<V>
extends java.util.concurrent.ExecutorCompletionService<V>
This is necessary because the base class, ExecutorCompletionService, does not provide any way of knowing how many results you need to read off before you know that you have read them all.
Constructor and Description |
---|
CountingCompletionService(java.util.concurrent.Executor executor) |
CountingCompletionService(java.util.concurrent.Executor executor,
java.util.concurrent.BlockingQueue<java.util.concurrent.Future<V>> queue) |
Modifier and Type | Method and Description |
---|---|
long |
getNumberOfCompletedTasks() |
long |
getNumberOfSubmittedTasks() |
boolean |
hasUncompletedTasks() |
java.util.concurrent.Future<V> |
poll() |
java.util.concurrent.Future<V> |
poll(long timeout,
java.util.concurrent.TimeUnit unit) |
java.util.concurrent.Future<V> |
submit(java.util.concurrent.Callable<V> task) |
java.util.concurrent.Future<V> |
submit(java.lang.Runnable task,
V result) |
java.util.concurrent.Future<V> |
take() |
public CountingCompletionService(java.util.concurrent.Executor executor)
public CountingCompletionService(java.util.concurrent.Executor executor, java.util.concurrent.BlockingQueue<java.util.concurrent.Future<V>> queue)
public java.util.concurrent.Future<V> take() throws java.lang.InterruptedException
public java.util.concurrent.Future<V> poll()
public java.util.concurrent.Future<V> poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
public long getNumberOfCompletedTasks()
public long getNumberOfSubmittedTasks()
public boolean hasUncompletedTasks()
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.