BatchQueue<T> constructor

BatchQueue<T>({
  1. required int batchSize,
  2. int timeout = 500,
  3. required BatchFunction<T> executeBatch,
})

Creates a new BatchQueue.

batchSize specifies the maximum number of items to process in a single batch. timeout specifies the time in milliseconds to wait before processing an incomplete batch. Defaults to 500ms. executeBatch is the function that will be called to process each batch of items.

Implementation

BatchQueue({
  required this.batchSize,
  this.timeout = 500, // unit is in ms
  required this.executeBatch,
});