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 newProcessSchedulerwhich also creates a newExecutorServiceProcessScheduler(Executor async) Create a newProcessScheduler -
Method Summary
Modifier and TypeMethodDescriptionrunProcesses(Process... processes) final <T> ResultedProcessesCompletion<T>runProcesses(ResultedProcess<T>... processes) Runs all the specifiedResultedProcesswhilst also returning aResultedProcessesCompletion.voidIf anExecutorServicehas been created/detected whilst thisProcessSchedulerwas created, this will call it'sExecutorService.shutdown()method.
-
Constructor Details
-
ProcessScheduler
public ProcessScheduler()Create a newProcessSchedulerwhich 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 specifiedResultedProcesswhilst 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 anExecutorServicehas been created/detected whilst thisProcessSchedulerwas created, this will call it'sExecutorService.shutdown()method.
-