V - The type of the futures provided by this servicepublic class ObservableExecutorCompletionService<V> extends Object implements CompletionService<V>
CompletionService that may be wrapped around an
ObservableExecutorService, and make sure that the tasks
that are actually submitted are ObservableTask instances.| Constructor and Description |
|---|
ObservableExecutorCompletionService(ObservableExecutorService observableExecutorService)
Creates a new instance that executes the tasks using the given
ObservableExecutorService |
ObservableExecutorCompletionService(ObservableExecutorService observableExecutorService,
BlockingQueue<Future<V>> completionQueue)
Creates a new instance that executes the tasks using the given
ObservableExecutorService, and puts the futures of the
completed tasks into the given (unbounded) queue |
public ObservableExecutorCompletionService(ObservableExecutorService observableExecutorService)
ObservableExecutorServiceobservableExecutorService - The executor to use. May not be
null.public ObservableExecutorCompletionService(ObservableExecutorService observableExecutorService, BlockingQueue<Future<V>> completionQueue)
ObservableExecutorService, and puts the futures of the
completed tasks into the given (unbounded) queueobservableExecutorService - The executor to use. May not be
null.completionQueue - The queue to receive the completed futurespublic Future<V> submit(Callable<V> task)
submit in interface CompletionService<V>public Future<V> submit(Runnable task, V result)
submit in interface CompletionService<V>public Future<V> take() throws InterruptedException
take in interface CompletionService<V>InterruptedExceptionpublic Future<V> poll()
poll in interface CompletionService<V>public Future<V> poll(long timeout, TimeUnit unit) throws InterruptedException
poll in interface CompletionService<V>InterruptedExceptionCopyright © 2016. All rights reserved.