Package com.landawn.abacus.util
Class AsyncExecutor
java.lang.Object
com.landawn.abacus.util.AsyncExecutor
- Since:
- 0.8
- Author:
- Haiyang Li
-
Constructor Summary
ConstructorDescriptionAsyncExecutor
(int coreThreadPoolSize, int maxThreadPoolSize, long keepAliveTime, TimeUnit unit) AsyncExecutor
(Executor executor) -
Method Summary
Modifier and TypeMethodDescriptionexecute
(Throwables.Runnable<? extends Exception> command) final List<ContinuableFuture<Void>>
execute
(Throwables.Runnable<? extends Exception>... commands) Deprecated.execute
(Throwables.Runnable<? extends Exception> action, int retryTimes, long retryIntervallInMillis, Predicate<? super Exception> retryCondition) execute
(Throwables.Runnable<? extends Exception> command, Runnable actionInFinal) <R> List<ContinuableFuture<R>>
execute
(Collection<? extends Callable<R>> commands) <R> ContinuableFuture<R>
final <R> List<ContinuableFuture<R>>
Deprecated.<R> ContinuableFuture<R>
execute
(Callable<R> action, int retryTimes, long retryIntervallInMillis, BiPredicate<? super R, ? super Exception> retryCondition) <R> ContinuableFuture<R>
execute
(List<? extends Throwables.Runnable<? extends Exception>> commands) Gets the executor.void
shutdown()
void
toString()
-
Constructor Details
-
AsyncExecutor
public AsyncExecutor() -
AsyncExecutor
public AsyncExecutor(int coreThreadPoolSize, int maxThreadPoolSize, long keepAliveTime, TimeUnit unit) - Parameters:
coreThreadPoolSize
-maxThreadPoolSize
-keepAliveTime
-unit
-
-
AsyncExecutor
- Parameters:
executor
-
-
-
Method Details
-
execute
- Parameters:
command
-- Returns:
-
execute
public ContinuableFuture<Void> execute(Throwables.Runnable<? extends Exception> command, Runnable actionInFinal) - Parameters:
command
-actionInFinal
-- Returns:
-
execute
@Deprecated @SafeVarargs public final List<ContinuableFuture<Void>> execute(Throwables.Runnable<? extends Exception>... commands) Deprecated.- Parameters:
commands
-- Returns:
-
execute
public List<ContinuableFuture<Void>> execute(List<? extends Throwables.Runnable<? extends Exception>> commands) - Parameters:
commands
-- Returns:
-
execute
- Type Parameters:
R
-- Parameters:
command
-- Returns:
-
execute
- Type Parameters:
R
-- Parameters:
command
-actioInFinal
-- Returns:
-
execute
@Deprecated @SafeVarargs public final <R> List<ContinuableFuture<R>> execute(Callable<R>... commands) Deprecated.- Type Parameters:
R
-- Parameters:
commands
-- Returns:
-
execute
- Type Parameters:
R
-- Parameters:
commands
-- Returns:
-
execute
public ContinuableFuture<Void> execute(Throwables.Runnable<? extends Exception> action, int retryTimes, long retryIntervallInMillis, Predicate<? super Exception> retryCondition) - Parameters:
action
-retryTimes
-retryIntervallInMillis
-retryCondition
-- Returns:
-
execute
public <R> ContinuableFuture<R> execute(Callable<R> action, int retryTimes, long retryIntervallInMillis, BiPredicate<? super R, ? super Exception> retryCondition) - Type Parameters:
R
-- Parameters:
action
-retryTimes
-retryIntervallInMillis
-retryCondition
-- Returns:
-
getExecutor
Gets the executor.- Returns:
-
shutdown
public void shutdown() -
shutdown
- Parameters:
terminationTimeout
-timeUnit
-
-
toString
-