public class ObservableExecutors extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
getInnerTask(Runnable task,
Class<T> type)
Utility method to obtain the task that may be wrapped in the
given task.
|
static ObservableExecutorService |
newCachedThreadPool()
Create a new
ObservableExecutorService with a cached thread
pool. |
static ObservableExecutorService |
newFixedThreadPool(int poolSize)
Create a new
ObservableExecutorService with the given
fixed pool size. |
public static ObservableExecutorService newFixedThreadPool(int poolSize)
ObservableExecutorService with the given
fixed pool size. See Executors.newFixedThreadPool(int)
for details.poolSize - The pool sizeObservableExecutorServicepublic static ObservableExecutorService newCachedThreadPool()
ObservableExecutorService with a cached thread
pool. See Executors.newCachedThreadPool().ObservableExecutorServicepublic static <T> T getInnerTask(Runnable task, Class<T> type)
ObservableTask,
then this method will obtain the
runnable of this task,
repeatedly, until it finds a runnable that is null or
no ObservableTask.ObservableTask, the Runnable and
Callable will be extracted. If either of them is not
null, and assignable to the given type, it will be
returned. Otherwise, null is returned.T - The type of the inner tasktask - The tasktype - The expected type of the inner tasknullCopyright © 2016. All rights reserved.