org.rococoa.contrib.dispatch
Class GCDExecutorService
java.lang.Object
java.util.concurrent.AbstractExecutorService
org.rococoa.contrib.dispatch.GCDExecutorService
- All Implemented Interfaces:
- Executor, ExecutorService
public class GCDExecutorService
- extends AbstractExecutorService
GCDExecutorService runs tasks by passing them to Grand Central Dispatch.
Presently, every GCDExecutorService creates its own
NSOperationQueue underneath.
- Author:
- Andrew Thompson (lordpixel@mac.com)
|
Constructor Summary |
GCDExecutorService()
Construct a new instance of the code ExecutorService, with its own underlying NSOperationQueue |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GCDExecutorService
public GCDExecutorService()
- Construct a new instance of the code
ExecutorService, with its own underlying NSOperationQueue
shutdown
public void shutdown()
shutdownNow
public List<Runnable> shutdownNow()
isShutdown
public boolean isShutdown()
isTerminated
public boolean isTerminated()
awaitTermination
public boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
- Throws:
InterruptedException
execute
public void execute(Runnable command)
newTaskFor
protected <T> RunnableFuture<T> newTaskFor(Runnable runnable,
T value)
- Overrides:
newTaskFor in class AbstractExecutorService
newTaskFor
protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable)
- Overrides:
newTaskFor in class AbstractExecutorService
Copyright © 2012. All Rights Reserved.