Class ConcurrentCollectorMultiple<DATATYPE>

java.lang.Object
com.helger.commons.concurrent.collector.AbstractConcurrentCollector<DATATYPE>
com.helger.commons.concurrent.collector.ConcurrentCollectorMultiple<DATATYPE>
Type Parameters:
DATATYPE - The type of the objects in the queue.
All Implemented Interfaces:
IConcurrentCollector, IMutableConcurrentCollector<DATATYPE>

public class ConcurrentCollectorMultiple<DATATYPE> extends AbstractConcurrentCollector<DATATYPE>
Concurrent collector that performs action on multiple objects at once
Author:
Philip Helger
  • Field Details

    • DEFAULT_MAX_PERFORM_COUNT

      public static final int DEFAULT_MAX_PERFORM_COUNT
      The default number of objects to be put in the queue for execution.
      See Also:
  • Constructor Details

    • ConcurrentCollectorMultiple

      public ConcurrentCollectorMultiple()
      Constructor that uses AbstractConcurrentCollector.DEFAULT_MAX_QUEUE_SIZE elements as the maximum queue length and DEFAULT_MAX_PERFORM_COUNT as the max perform count.
    • ConcurrentCollectorMultiple

      public ConcurrentCollectorMultiple(@Nonnegative int nMaxQueueSize, @Nonnegative int nMaxPerformCount)
      Constructor.
      Parameters:
      nMaxQueueSize - The maximum number of items that can be in the queue. Must be > 0.
      nMaxPerformCount - The maximum number of objects to be put in the queue for execution. Must be > 0.
    • ConcurrentCollectorMultiple

      public ConcurrentCollectorMultiple(@Nonnull BlockingQueue<Object> aQueue)
      Constructor using an existing BlockingQueue and the default max perform count (50<DATATYPE>).
      Parameters:
      aQueue - BlockingQueue to use. May not be null.
    • ConcurrentCollectorMultiple

      public ConcurrentCollectorMultiple(@Nonnull BlockingQueue<Object> aQueue, @Nonnegative int nMaxPerformCount)
      Constructor using an existing BlockingQueue.
      Parameters:
      aQueue - BlockingQueue to use. May not be null.
      nMaxPerformCount - The maximum number of objects to be put in the list for execution. Must be > 0.
  • Method Details