Package com.mrivanplays.process
Class ProcessScheduler
java.lang.Object
com.mrivanplays.process.ProcessScheduler
Represents a scheduler of
Processes
.- Since:
- 0.0.1
- Author:
- Ivan Pekov
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a newProcessScheduler
which also creates a newExecutorService
ProcessScheduler
(Executor async) Create a newProcessScheduler
-
Method Summary
Modifier and TypeMethodDescriptionrunProcesses
(Process... processes) final <T> ResultedProcessesCompletion<T>
runProcesses
(ResultedProcess<T>... processes) Runs all the specifiedResultedProcess
whilst also returning aResultedProcessesCompletion
.void
If anExecutorService
has been created/detected whilst thisProcessScheduler
was created, this will call it'sExecutorService.shutdown()
method.
-
Constructor Details
-
ProcessScheduler
public ProcessScheduler()Create a newProcessScheduler
which also creates a newExecutorService
-
ProcessScheduler
Create a newProcessScheduler
- Parameters:
async
- executor in which processes are executed
-
-
Method Details
-
runProcesses
- Parameters:
processes
- the processes to run- Returns:
- a process completion
- See Also:
-
runProcesses
@SafeVarargs public final <T> ResultedProcessesCompletion<T> runProcesses(ResultedProcess<T>... processes) Runs all the specifiedResultedProcess
whilst also returning aResultedProcessesCompletion
.- Type Parameters:
T
- result value type parameter- Parameters:
processes
- the resulted processes to run- Returns:
- a process completion
- See Also:
-
shutdownExecutorService
If anExecutorService
has been created/detected whilst thisProcessScheduler
was created, this will call it'sExecutorService.shutdown()
method.
-