Class GTaskSchedulerService

All Implemented Interfaces:
GTaskScheduler, AutoCloseable, Executor

public final class GTaskSchedulerService extends GTaskExecutorService<ScheduledExecutorService> implements GTaskScheduler
A scheduler utility on top of ScheduledExecutorService.

This class standardizes the interface to use Duration for timings.

  • Constructor Details

    • GTaskSchedulerService

      public GTaskSchedulerService()
      Creates a task scheduler with a single worker thread.
    • GTaskSchedulerService

      public GTaskSchedulerService(Integer threadCount)
      Creates a task scheduler with a fixed thread pool.
      Parameters:
      threadCount - Thread count for this scheduler.
    • GTaskSchedulerService

      public GTaskSchedulerService(ScheduledExecutorService runner)
      Creates a task scheduler with the given ScheduledExecutorService.

      This scheduler owns the given ScheduledExecutorService and will shut it down and close it when the scheduler is closed.

      Parameters:
      runner - ScheduledExecutorService to use as scheduler.
  • Method Details