Skip to content

Commit 413af48

Browse files
dreamorosiam29d
andauthored
chore(docs): update batch docs highlight & links (#2320)
Co-authored-by: Alexander Schueren <[email protected]>
1 parent b958548 commit 413af48

File tree

3 files changed

+9
-44
lines changed

3 files changed

+9
-44
lines changed

Diff for: docs/snippets/batch/gettingStartedAsync.ts

-31
This file was deleted.

Diff for: docs/utilities/batch.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -423,12 +423,11 @@ For these scenarios, you can subclass `BatchProcessor` and quickly override `suc
423423
* **`successHandler()`** – Keeps track of successful batch records
424424
* **`failureHandler()`** – Keeps track of failed batch records
425425

426-
???+ example
427-
Let's suppose you'd like to add a metric named `BatchRecordFailures` for each batch record that failed processing
428-
429-
```typescript hl_lines="17 21 25 31 35" title="Extending failure handling mechanism in BatchProcessor"
430-
--8<-- "docs/snippets/batch/extendingFailure.ts"
431-
```
426+
Let's suppose you'd like to add a metric named `BatchRecordFailures` for each batch record that failed processing
427+
428+
```typescript hl_lines="3 20 24 31 37" title="Extending failure handling mechanism in BatchProcessor"
429+
--8<-- "docs/snippets/batch/extendingFailure.ts"
430+
```
432431

433432
### Create your own partial processor
434433

@@ -463,7 +462,7 @@ classDiagram
463462

464463
You can then use this class as a context manager, or pass it to `processPartialResponseSync` to process the records in your Lambda handler function.
465464

466-
```typescript hl_lines="21 30 41 62 73 84" title="Creating a custom batch processor"
465+
```typescript hl_lines="21 35 56 61 73 86" title="Creating a custom batch processor"
467466
--8<-- "docs/snippets/batch/customPartialProcessor.ts"
468467
```
469468

Diff for: packages/batch/README.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ import {
177177
EventType,
178178
processPartialResponse,
179179
} from '@aws-lambda-powertools/batch';
180-
import axios from 'axios'; // axios is an external dependency
181180
import type {
182181
SQSEvent,
183182
SQSRecord,
@@ -188,8 +187,8 @@ import type {
188187
const processor = new BatchProcessor(EventType.SQS);
189188

190189
const recordHandler = async (record: SQSRecord): Promise<number> => {
191-
const res = await axios.post('https://httpbin.org/anything', {
192-
message: record.body,
190+
const res = await fetch('https://httpbin.org/anything', {
191+
body: JSON.stringify({ message: record.body }),
193192
});
194193

195194
return res.status;
@@ -207,8 +206,6 @@ export const handler = async (
207206

208207
Check the [docs](https://docs.powertools.aws.dev/lambda/typescript/latest/utilities/batch/) for more examples.
209208

210-
211-
212209
## Contribute
213210

214211
If you are interested in contributing to this project, please refer to our [Contributing Guidelines](https://github.com/aws-powertools/powertools-lambda-typescript/blob/main/CONTRIBUTING.md).
@@ -249,7 +246,7 @@ Share what you did with Powertools for AWS Lambda (TypeScript) 💞💞. Blog po
249246

250247
### Using Lambda Layer
251248

252-
This helps us understand who uses Powertools for AWS Lambda (TypeScript) in a non-intrusive way, and helps us gain future investments for other Powertools for AWS Lambda languages. When [using Layers](#lambda-layers), you can add Powertools as a dev dependency (or as part of your virtual env) to not impact the development process.
249+
This helps us understand who uses Powertools for AWS Lambda (TypeScript) in a non-intrusive way, and helps us gain future investments for other Powertools for AWS Lambda languages. When [using Layers](https://docs.powertools.aws.dev/lambda/typescript/latest/#lambda-layer), you can add Powertools as a dev dependency (or as part of your virtual env) to not impact the development process.
253250

254251
## Credits
255252

0 commit comments

Comments
 (0)