public final class JreExecutorUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
executeInThreadsAndWait(executorService : ExecutorService,
tasks : Collection<Runnable>,
interceptExceptions : boolean,
wrapper : (Boolean,Runnable)=>Runnable)
Execute the given tasks in parallel and wait for the termination.
|
static int |
executeInThreadsAndWait(executorService : ExecutorService,
task : SreRunnable,
nbExecutions : int,
runGroupSize : int)
Execute the given task in parallel and wait for the termination.
|
static void |
executeInThreadsWithoutWaiting(executorService : ExecutorService,
task : SreRunnable,
nbExecutions : int,
runGroupSize : int)
Execute the given task in parallel but do not wait for the termination.
|
public static def
executeInThreadsAndWait(executorService : ExecutorService,
tasks : Collection<Runnable>,
interceptExceptions : boolean,
wrapper : (Boolean,Runnable)=>Runnable) : void
JreExecutorUtils
executorService
- the service to use.tasks
- the tasks to run.interceptExceptions
- indicates if the exceptions in the tasks are thrown into a combined exception.a
- callback for wrapping the tasks. The first argument of the lambda indicates if the errors should be catched and
the second argument is the task to run.public static def
executeInThreadsAndWait(executorService : ExecutorService,
task : SreRunnable,
nbExecutions : int,
runGroupSize : int) : int
JreExecutorUtils
executorService
- the service to use.task
- the task to run.nbExecutions
- number of runsrunGroupSize
- the size of a parallel grouppublic static def
executeInThreadsWithoutWaiting(executorService : ExecutorService,
task : SreRunnable,
nbExecutions : int,
runGroupSize : int) : void
JreExecutorUtils
executorService
- the service to use.task
- the task to run.nbExecutions
- number of runsrunGroupSize
- the size of a parallel groupCopyright © 2021 the original authors or authors.