io.sarl.sre.janus.services.executor
Class JreExecutorUtils
final class JreExecutorUtils
extends java.lang.Object
Utilities for running tasks on the standard JRE executor service.
Maven Group Identifier:
io.sarl.sre.janus
Maven Artifact Identifier:
janus.kernel
Since:
0.11
Action Summary
Modifier and type Action and description
static int executeInThreadsAndWait(ExecutorService,SreRunnable,int,int)
Execute the given task in parallel and wait for the termination.
static void executeInThreadsAndWait(ExecutorService,Collection<E>,boolean,Function2<P1,P2,Result>)
Execute the given tasks in parallel and wait for the termination.
static void executeInThreadsWithoutWaiting(ExecutorService,SreRunnable,int,int)
Execute the given task in parallel but do not wait for the termination.
Action Details
executeInThreadsAndWait(ExecutorService,SreRunnable,int,int)
def executeInThreadsAndWait(ExecutorService,SreRunnable,int,int) : int
Execute the given task in parallel and wait for the termination.
Parameters:
executorService - the service to use.
task - the task to run.
nbExecutions - number of runs
runGroupSize - the size of a parallel group
executeInThreadsAndWait(ExecutorService,Collection<E>,boolean,Function2<P1,P2,Result>)
def executeInThreadsAndWait(ExecutorService,Collection<E>,boolean,Function2<P1,P2,Result>)
Execute the given tasks in parallel and wait for the termination.
Parameters:
executorService - the service to use.
tasks - the tasks to run.
interceptExceptions - indicates if the exceptions in the tasks are thrown into a combined exception.
wrapper - 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.
executeInThreadsWithoutWaiting(ExecutorService,SreRunnable,int,int)
def executeInThreadsWithoutWaiting(ExecutorService,SreRunnable,int,int)
Execute the given task in parallel but do not wait for the termination.
Parameters:
executorService - the service to use.
task - the task to run.
nbExecutions - number of runs
runGroupSize - the size of a parallel group