public class RunUtil
extends java.lang.Object
构造器和说明 |
---|
RunUtil() |
限定符和类型 | 方法和说明 |
---|---|
static java.util.concurrent.CompletableFuture<java.lang.Void> |
async(java.lang.Runnable task)
异步执行
|
static <U> java.util.concurrent.CompletableFuture<U> |
async(java.util.function.Supplier<U> task)
异步执行
|
static java.util.concurrent.CompletableFuture<java.lang.Void> |
asyncAndTry(RunnableEx task)
异步执行并吃掉异常
|
static java.util.concurrent.ScheduledFuture<?> |
delay(java.lang.Runnable task,
long millis)
延迟执行
|
static java.util.concurrent.ScheduledFuture<?> |
delayAndRepeat(java.lang.Runnable task,
long millis)
延迟执行并重复
|
static <T> java.util.concurrent.Future<T> |
parallel(java.util.concurrent.Callable<T> task)
已过时。
3.0
|
static java.util.concurrent.Future<?> |
parallel(java.lang.Runnable task)
已过时。
3.0
|
static void |
runAndTry(RunnableEx task)
运行并吃掉异常
|
static void |
runOrThrow(RunnableEx task)
运行或异常
|
static java.util.concurrent.ScheduledFuture<?> |
scheduleAtFixedRate(java.lang.Runnable task,
long initialDelay,
long millisPeriod)
定时任务
|
static java.util.concurrent.ScheduledFuture<?> |
scheduleWithFixedDelay(java.lang.Runnable task,
long initialDelay,
long millisDelay)
定时任务
|
static void |
setAsyncExecutor(java.util.concurrent.ExecutorService asyncExecutor)
设置异步执行器
|
static void |
setParallelExecutor(java.util.concurrent.ExecutorService parallelExecutor)
已过时。
3.0
|
static void |
setScheduledExecutor(java.util.concurrent.ScheduledExecutorService scheduledExecutor)
设置调度执行器
|
@Deprecated public static void setParallelExecutor(java.util.concurrent.ExecutorService parallelExecutor)
public static void setScheduledExecutor(java.util.concurrent.ScheduledExecutorService scheduledExecutor)
public static void setAsyncExecutor(java.util.concurrent.ExecutorService asyncExecutor)
public static void runOrThrow(RunnableEx task)
public static void runAndTry(RunnableEx task)
@Deprecated public static java.util.concurrent.Future<?> parallel(java.lang.Runnable task)
@Deprecated public static <T> java.util.concurrent.Future<T> parallel(java.util.concurrent.Callable<T> task)
public static java.util.concurrent.CompletableFuture<java.lang.Void> async(java.lang.Runnable task)
public static <U> java.util.concurrent.CompletableFuture<U> async(java.util.function.Supplier<U> task)
public static java.util.concurrent.CompletableFuture<java.lang.Void> asyncAndTry(RunnableEx task)
public static java.util.concurrent.ScheduledFuture<?> delay(java.lang.Runnable task, long millis)
public static java.util.concurrent.ScheduledFuture<?> delayAndRepeat(java.lang.Runnable task, long millis)
public static java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable task, long initialDelay, long millisPeriod)
public static java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable task, long initialDelay, long millisDelay)