Class ApiRequestDelayedBatcher<T>
java.lang.Object
software.amazon.lambda.durable.execution.ApiRequestDelayedBatcher<T>
- Type Parameters:
T- Request type
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 Summary
Constructors -
Method Summary
-
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 batchmaxBatchBytes- Maximum total size in bytes for all items in a batchcalculateItemSize- Function to calculate the size in bytes of each itemexecuteBatch- Function to execute the batch action
-