Class GSequentialWorkQueueTask<T>

java.lang.Object
com.glitchybyte.glib.concurrent.GTask
com.glitchybyte.glib.concurrent.workqueue.GWorkQueueTask<T>
com.glitchybyte.glib.concurrent.workqueue.GSequentialWorkQueueTask<T>
Type Parameters:
T - Type of work item.
All Implemented Interfaces:
GWorkQueue<T>, Runnable

public final class GSequentialWorkQueueTask<T> extends GWorkQueueTask<T>
A task implementation of a {code GAsyncWorkQueue} that processes work items sequentially.
  • Constructor Details

    • GSequentialWorkQueueTask

      public GSequentialWorkQueueTask(String threadName, Consumer<T> processor)
      Creates a sequential work queue task.
      Parameters:
      threadName - Thread name.
      processor - Work item processor.
  • Method Details

    • processWork

      protected void processWork()
      Description copied from class: GWorkQueueTask
      This method processes each work item.

      Implementations MUST call workQueue.doWork.

      Specified by:
      processWork in class GWorkQueueTask<T>