Class TaskBatcher.BatchedTask

  • All Implemented Interfaces:
    java.lang.Comparable<PrioritizedRunnable>, java.lang.Runnable
    Enclosing class:

    protected abstract class TaskBatcher.BatchedTask
    extends SourcePrioritizedRunnable
    Represents a runnable task that supports batching. Implementors of TaskBatcher can subclass this to add a payload to the task.
    • Field Detail

      • processed

        protected final java.util.concurrent.atomic.AtomicBoolean processed
        whether the task has been processed already
      • batchingKey

        protected final java.lang.Object batchingKey
        the object that is used as batching key
      • task

        protected final java.lang.Object task
        the task object that is wrapped
    • Constructor Detail

      • BatchedTask

        protected BatchedTask​(Priority priority,
                              java.lang.String source,
                              java.lang.Object batchingKey,
                              java.lang.Object task)
    • Method Detail

      • run

        public void run()
      • describeTasks

        public abstract java.lang.String describeTasks​(java.util.List<? extends TaskBatcher.BatchedTask> tasks)
      • getTask

        public java.lang.Object getTask()