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/utilities/batch.md
+5-4
Original file line number
Diff line number
Diff line change
@@ -319,15 +319,16 @@ For these scenarios, you can subclass `BatchProcessor` and quickly override `suc
319
319
320
320
### Create your own partial processor
321
321
322
-
You can create your own partial batch processor from scratch by inheriting the `BasePartialProcessor` class, and implementing `_prepare()`, `_clean()`and `_process_record()`.
322
+
You can create your own partial batch processor from scratch by inheriting the `BasePartialProcessor` class, and implementing `_prepare()`, `_clean()`, `_process_record()`and `_async_process_record()`.
323
323
324
324
***`_process_record()`** – handles all processing logic for each individual message of a batch, including calling the `record_handler` (self.handler)
325
325
***`_prepare()`** – called once as part of the processor initialization
326
-
***`clean()`** – teardown logic called once after `_process_record` completes
326
+
***`_clean()`** – teardown logic called once after `_process_record` completes
327
+
***`_async_process_record()`** – If you need to implement asynchronous logic, use this method, otherwise define it in your class with empty logic
327
328
328
329
You can then use this class as a context manager, or pass it to `batch_processor` to use as a decorator on your Lambda handler function.
@@ -371,7 +372,7 @@ Given a SQS batch where the first batch record succeeds and the second fails pro
371
372
372
373
## FAQ
373
374
374
-
### Choosing between decorator and context manager
375
+
### Choosing between method and context manager
375
376
376
377
Use context manager when you want access to the processed messages or handle `BatchProcessingError` exception when all records within the batch fail to be processed.
0 commit comments