Class ApiRequestDelayedBatcher<T>

java.lang.Object
software.amazon.lambda.durable.execution.ApiRequestDelayedBatcher<T>
Type Parameters:
T - Request type

public class ApiRequestDelayedBatcher<T> extends Object
Batches API requests to optimize throughput by grouping individual calls into batch operations. Batches are flushed when full, when size limits are reached, or after a timeout.

Uses a dedicated SDK thread pool for internal coordination, keeping checkpoint processing separate from customer-configured executors used for user-defined operations.

See Also:
  • InternalExecutor
  • Constructor Details

    • ApiRequestDelayedBatcher

      public ApiRequestDelayedBatcher(int maxItemCount, int maxBatchBytes, Function<T,Integer> calculateItemSize, Consumer<List<T>> executeBatch)
      Creates a new ApiRequestDelayedBatcher with the specified configuration.
      Parameters:
      maxItemCount - Maximum number of items per batch
      maxBatchBytes - Maximum total size in bytes for all items in a batch
      calculateItemSize - Function to calculate the size in bytes of each item
      executeBatch - Function to execute the batch action