You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/features/batch.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,7 @@ Processing batches from SQS works in three stages:
108
108
3. Use **`processPartialResponse`** to kick off processing
109
109
110
110
!!! note
111
-
By default, the batch processor will process messages in parallel, which does not guarantee the order of processing. If you need to process messages in order, set the [`processInParallel` option to `false`](#sequential-async-processing), or use [`SqsFifoPartialProcessor` for SQS FIFO queues](#fifo-queues).
111
+
By default, the batch processor will process messages in parallel, which does not guarantee the order of processing. If you need to process messages in order, set the [`processInParallel` option to `false`](#sequential-processing), or use [`SqsFifoPartialProcessor` for SQS FIFO queues](#fifo-queues).
112
112
113
113
=== "index.ts"
114
114
@@ -235,7 +235,7 @@ By default, we catch any exception raised by your record handler function. This
235
235
--8<--
236
236
```
237
237
238
-
1. Any exception works here. See [extending BatchProcessorSync section, if you want to override this behavior.](#extending-batchprocessor)
238
+
1. Any exception works here. See [extending `BatchProcessor` section, if you want to override this behavior.](#extending-batchprocessor)
239
239
240
240
2. Exceptions raised in `recordHandler` will propagate to `process_partial_response`. <br/><br/> We catch them and include each failed batch item identifier in the response dictionary (see `Sample response` tab).
241
241
@@ -411,7 +411,7 @@ Use the `BatchProcessor` directly in your function to access a list of all retur
411
411
412
412
Within your `recordHandler` function, you might need access to the Lambda context to determine how much time you have left before your function times out.
413
413
414
-
We can automatically inject the [Lambda context](https://docs.aws.amazon.com/lambda/latest/dg/typescript-context.html){target="_blank"} into your `recordHandler` as optional second argument if you register it when using `BatchProcessorSync` or the `processPartialResponseSync` function.
414
+
We can automatically inject the [Lambda context](https://docs.aws.amazon.com/lambda/latest/dg/typescript-context.html){target="_blank"} into your `recordHandler` as optional second argument if you pass it to the `processPartialResponse` function.
By default, the `BatchProcessor` processes records in parallel using `Promise.all()`. However, if you need to preserve the order of records, you can set the `processInParallel` option to `false` to process records sequentially.
450
450
451
451
!!! important "If the `processInParallel` option is not provided, the `BatchProcessor` will process records in parallel."
452
452
453
453
When processing records from SQS FIFO queues, we recommend using the [`SqsFifoPartialProcessor`](#fifo-queues) class, which guarantees ordering of records and implements a short-circuit mechanism to skip processing records from a different message group ID.
***`processRecord()`** – If you need to implement asynchronous logic, use this method, otherwise define it in your class with empty logic
488
488
***`processRecordSync()`** – handles all processing logic for each individual message of a batch, including calling the `recordHandler` (`this.handler`)
489
489
490
-
You can then use this class as a context manager, or pass it to `processPartialResponseSync` to process the records in your Lambda handler function.
490
+
You can then pass this class to `processPartialResponse` to process the records in your Lambda handler function.
0 commit comments