public class ParallelTaskScheduler extends Object implements ParallelScheduler, ExecutorService
ParallelScheduler.Identify<T>, ParallelScheduler.SelfIdentify<T extends Number>, ParallelScheduler.TaskExecutor<T>, ParallelScheduler.TaskProvider<T>| 构造器和说明 |
|---|
ParallelTaskScheduler() |
ParallelTaskScheduler(int corePoolSize) |
ParallelTaskScheduler(ThreadPoolExecutor exePool) |
public ParallelTaskScheduler()
public ParallelTaskScheduler(int corePoolSize)
public ParallelTaskScheduler(ThreadPoolExecutor exePool)
public <T> void schedule(int concurrency,
ParallelScheduler.TaskProvider<T> provider,
ParallelScheduler.TaskExecutor<T> executor)
schedule 在接口中 ParallelSchedulerconcurrency - 最大并发量provider - 任务提供者executor - 任务执行器public <T> void schedule(int concurrency,
ParallelScheduler.TaskProvider<T> provider,
ParallelScheduler.TaskExecutor<T> executor,
ParallelScheduler.Identify<T> identify)
schedule 在接口中 ParallelSchedulerconcurrency - 最大并发量provider - 任务提供者executor - 任务执行器identify - 任务标识器,用于对provider提供的任务进行去重public <T> Future<?> asyncSchedule(int concurrency, ParallelScheduler.TaskProvider<T> provider, ParallelScheduler.TaskExecutor<T> executor)
asyncSchedule 在接口中 ParallelSchedulerconcurrency - 最大并发量provider - 任务提供者executor - 任务执行器public <T> Future<?> asyncSchedule(int concurrency, ParallelScheduler.TaskProvider<T> provider, ParallelScheduler.TaskExecutor<T> executor, ParallelScheduler.Identify<T> identify)
asyncSchedule 在接口中 ParallelSchedulerconcurrency - 最大并发量provider - 任务提供者executor - 任务执行器identify - 任务标识器,用于对provider提供的任务进行去重public void shutdown()
shutdown 在接口中 ExecutorServicepublic List<Runnable> shutdownNow()
shutdownNow 在接口中 ExecutorServicepublic boolean isShutdown()
isShutdown 在接口中 ExecutorServicepublic boolean isTerminated()
isTerminated 在接口中 ExecutorServicepublic boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
awaitTermination 在接口中 ExecutorServiceInterruptedExceptionpublic <T> Future<T> submit(Callable<T> task)
submit 在接口中 ExecutorServicepublic <T> Future<T> submit(Runnable task, T result)
submit 在接口中 ExecutorServicepublic Future<?> submit(Runnable task)
submit 在接口中 ExecutorServicepublic <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException
invokeAll 在接口中 ExecutorServiceInterruptedExceptionpublic <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException
invokeAll 在接口中 ExecutorServiceInterruptedExceptionpublic <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException
invokeAny 在接口中 ExecutorServiceInterruptedExceptionExecutionExceptionpublic <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
protected <T> void submitTasks(int concurrency,
Queue<T> tasks,
ParallelScheduler.TaskExecutor<T> executor,
List<Future<?>> futures)
public void setBatchSize(int batchSize)
public void setVerbose(boolean verbose)
Copyright © 2024. All rights reserved.