Class ThrottlingAggregator<T>

java.lang.Object
com.inductiveautomation.ignition.common.util.ThrottlingAggregator<T>

public class ThrottlingAggregator<T> extends Object
Aggregates items, grouping them if they are submitted consecutively within a specified delay or if a specified maximum delivery frequency dictates that no more deliveries can be made at the time.

Delivery happens when either of the following occur:

  • The time since the last item submitted is longer than the specified delay and a delivery wasn't sent out too recently.
  • There are items waiting to be delivered and a period of time longer than the specified frequency elapses.
  • Constructor Details

    • ThrottlingAggregator

      public ThrottlingAggregator(long delay, long maxFrequency, ThrottlingAggregator.Callback<T> callback)
      Create a ThrottlingAggregator with the given parameters.
      Parameters:
      delay - How long to wait for another call to processItem before attempting delivery. During this delay is where aggregation happens.
      maxFrequency - The maximum frequency at which aggregated items should be delivered.
      callback - A callback that aggregated items will be delivered to.
  • Method Details

    • processItem

      public void processItem(T item)