| public interface java.util.concurrent CompletionService<V>
|
Java SE 6 |
Typically, a CompletionService relies on a separate
Executor to actually execute the tasks, in which case the
CompletionService only manages an internal completion
queue. The ExecutorCompletionService class provides an
implementation of this approach.
Memory consistency effects: Actions in a thread prior to
submitting a task to a CompletionService
happen-before
actions taken by that task, which in turn happen-before
actions following a successful return from the corresponding take().
| Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public Future | poll() Retrieves and removes the Future representing the next completed task or null if none are present.
| ||||||||||
| public Future | poll(long timeout, TimeUnit unit) throws InterruptedException Retrieves and removes the Future representing the next completed task, waiting if necessary up to the specified wait time if none are yet present.
| ||||||||||
| public Future | submit(Callable task) Submits a value-returning task for execution and returns a Future representing the pending results of the task. Upon completion, this task may be taken or polled.
| ||||||||||
| public Future | submit(Runnable task, Object result) Submits a Runnable task for execution and returns a Future representing that task. Upon completion, this task may be taken or polled.
| ||||||||||
| public Future | take() throws InterruptedException Retrieves and removes the Future representing the next completed task, waiting if none are yet present.
| ||||||||||
| About DocWeb · Bundles · Export · Export All | Top 10 · Statistics · Login |
| About Sun · Contact · Privacy · Terms of Use · Trademarks | Java SE 6 · Copyright © 1994-2009 Sun Microsystems, Inc.All rights reserved. Use is subject to license terms |
![]() |
![]() |
|