Package com.glitchybyte.glib.concurrent
Class GTaskExecutorService<ES extends ExecutorService>
java.lang.Object
com.glitchybyte.glib.concurrent.GTaskExecutorService<ES>
- Type Parameters:
ES- AnExecutorServiceor descendant.
- All Implemented Interfaces:
AutoCloseable,Executor
- Direct Known Subclasses:
GTaskRunnerService,GTaskSchedulerService
public abstract sealed class GTaskExecutorService<ES extends ExecutorService>
extends Object
implements Executor, AutoCloseable
permits GTaskRunnerService, GTaskSchedulerService
Abstract class for task runner facilities.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGTaskExecutorService(ES runner) Creates a task runner with the givenExecutorService. -
Method Summary
-
Field Details
-
runner
ActualExecutorServicerunner.
-
-
Constructor Details
-
GTaskExecutorService
Creates a task runner with the givenExecutorService.This runner owns the given
ExecutorServiceand will shut it down and close it when the runner is closed.- Parameters:
runner-ExecutorServiceto use as runner.
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
createTaskWrapper
Creates a wrapper around the givenGTaskthat sets the thread name, if given, and marks task as done when it's done. -
execute
-