Skip to content

Commit 6d668d9

Browse files
docs: small fixes
1 parent 946d9f8 commit 6d668d9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/utilities/batch.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -319,15 +319,16 @@ For these scenarios, you can subclass `BatchProcessor` and quickly override `suc
319319

320320
### Create your own partial processor
321321

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()`.
323323

324324
* **`_process_record()`** – handles all processing logic for each individual message of a batch, including calling the `record_handler` (self.handler)
325325
* **`_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
327328

328329
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.
329330

330-
```python hl_lines="9 16 31 37 44 55 68" title="Creating a custom batch processor"
331+
```python hl_lines="9 16 31 37 44 55 60 68" title="Creating a custom batch processor"
331332
--8<-- "examples/batch_processing/src/custom_partial_processor.py"
332333
```
333334

@@ -371,7 +372,7 @@ Given a SQS batch where the first batch record succeeds and the second fails pro
371372

372373
## FAQ
373374

374-
### Choosing between decorator and context manager
375+
### Choosing between method and context manager
375376

376377
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.
377378

0 commit comments

Comments
 (0)