Package org.polyfrost.oneconfig.utils.v1
Class Multithreading
java.lang.Object
org.polyfrost.oneconfig.utils.v1.Multithreading
Allows for easy multithreading
Modified from Seraph by Scherso under LGPL-2.1 https://github.com/Scherso/Seraph/blob/master/LICENSE
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExecutorServicestatic ScheduledExecutorServicestatic voidSchedules the runnable to run asynchronously after the specified delaystatic Future<?> Submits the Runnable to the executor so it runs asynchronouslystatic voidRuns the provided runnables asynchronouslystatic ScheduledFuture<?> submitScheduled(Runnable runnable, long delay, TimeUnit timeUnit) Submits the Runnable to the executor after a delay so it runs asynchronously
-
Method Details
-
submit
Runs the provided runnables asynchronously- Parameters:
runnables- The runnables to run- See Also:
-
submit
Submits the Runnable to the executor so it runs asynchronously- Parameters:
runnable- The runnable to run- Returns:
- The future representing the submitted runnable
- See Also:
-
schedule
Schedules the runnable to run asynchronously after the specified delay- Parameters:
runnable- The runnable to rundelay- The delay before the runnable is runtimeUnit- TheTimeUnitof the delay- See Also:
-
submitScheduled
Submits the Runnable to the executor after a delay so it runs asynchronously- Parameters:
runnable- The runnable to rundelay- The delay before the runnable is runtimeUnit- TheTimeUnitof the delay- Returns:
- The future representing the submitted runnable
- See Also:
-
getExecutor
-
getScheduledExecutor
-